The reference object is used to specify the style and location of the text that identifies a component.
Syntax: |
---|
DlxLayer.DrawNetlabel(insertionPoint, name, netClass = "", rotationAngle = 0, alignment = DlxApp.TEXTALIGN_DEFAULT) |
Parameters
Parameter | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
insertionPoint | A DlxPoint object with the coordinates of the insertion point. The point of insertion of a Nel label is its electric hotspot. A Net label must always be placed next to a wire or bus line so that its insertion point identifies the object to which it is assigned. | ||||||||||||||||||||||||||||||
name |
Specify the name to assign to the connection.
If the net label is attached to a bus line, specify all the signals propagated by the bus by separating them with a comma.
The groups of signals that have the name formed by a prefix followed by a progressive numerical index (for example the data lines of a memory component: D0, D1, D2 etc.),
can be specified using the following form:
prefix[start_index..end_index] Examples:
|
||||||||||||||||||||||||||||||
netClass | A string containing the name or handle of the class. The Net classes define the styles of the connections. They include the wire style in schematics and the DRC and Routing classes for the PCB. | ||||||||||||||||||||||||||||||
rotationAngle | The angle, in degrees, of rotation of the text with respect to the x-axis. | ||||||||||||||||||||||||||||||
alignment | Specifies the horizontal and vertical alignment of the text with respect to the insertion point.
Enter the following values:
|
Return Value
The last newly created DlxNetlabel 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.DrawLine(new DlxPoint(50,100), new DlxPoint(120,100), true);
layer.DrawNetlabel(new DlxPoint(90,100), "VCC", "power", 0, DlxApp.TEXTALIGN_BOTTOMLEFT);
}
}
}
|