Creates a frame. Frame objects are used to define symbols.
Syntax: |
DlxLayer.DrawFrame(rect, number, name = "", info = ")
|
Parameters
Parameter |
Description |
rect |
A DlxRect object that specifies the frame rectangle. |
number |
A string that specifies the part number. |
name |
A string that specifies the name to assign to the symbol. |
info |
A string with a brief description of the symbol. |
Return Value
The last newly created DlxFrame 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_LIBRARYFRAMES);
if (layer.IsValid())
{
var rect = new DlxRect(50,40,120,90);
layer.DrawFrame(rect, 1, "NAND", "The NAND gate.");
}
}
}
|
See also