Create a shape consisting of lines, curves, and arcs.

syntaxSyntax:
DlxFigure.SetShape(shape)
DlxFigure.SetShape(shapeDef)

Parameters

Parameter Description
shape A DlxFigure object with the shape to be copied.
shapeDef String with the definition of the shape. For more information, see Shape Format Specifications.

Return Value

If the operation ends correctly it returns true otherwise if an error occurs this method returns false and the shape is empty.

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
  doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.GetActivePage();
  if (page.IsValid())
  {
    var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
    if (layer.IsValid())
    {
      // draw shape
      var shape = layer.DrawShape();
      var figure = shape.GetFigure();
      figure.SetShape("V90,110,0;V110,130,0;V130,110,0;V90,110,-120;");     
    }
  }
}

See also