Insert a clipart into the drawing.
Syntax: |
DlxLayer.DrawClipart(insertionPoint, name, rotationAngle = 0)
|
Parameters
Parameter |
Description |
insertionPoint |
A DlxPoint object with the coordinates on the drawing where the image is placed. |
name |
A string that specifies the
name of clipart. The clipart must be present in the library files. |
rotationAngle |
The angle, in degrees, of rotation of the image with respect to the x-axis. |
Return Value
The last newly created DlxObject object. Call the IsValid() method to determine if the
object was created correctly.
Example
|
Copy 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())
{
layer.DrawClipart(new DlxPoint(90,100), "IEEE_HYSTERESIS");
}
}
}
|
See also