Constructs a DlxTrackStyle object.
Syntax: |
---|
new DlxTrackStyle() new DlxTrackStyle(name) new DlxTrackStyle(handle) new DlxTrackStyle(style) new DlxTrackStyle(width) |
Parameters
Parameter | Description |
---|---|
name | A string containing the name of the style. |
handle | A string containing the handle of the style. |
style | A DlxTrackStyle object from which to copy the style. |
width | The width of the track. |
Remarks
The style handle is a 27-character alphanumeric string and appears in the box at the bottom of the Style Manager dialog box.
Example
Copy code | |
---|---|
var prj = DlxApp.GetJob().GetProject("Example PCB");
if (!prj.IsValid())
prj = DlxApp.GetJob().NewProject("Example PCB");
var doc = prj.GetDocument("Examples PCB", DlxApp.DOCTYPE_PCB);
if (!doc.IsValid())
{
doc = prj.NewDocument("Examples Pcb", DlxApp.DOCTYPE_PCB);
doc.SetPageFormat("A4", false);
var page = doc.NewPage("PCB", 0, true);
page.LoadLayerStack("2 layer pcb stackup.clxlys");
page.DrawBoard(new DlxRect(10, 10, 290, 200));
page.SelectView("Draw Copper From Top");
}
if (doc.IsValid() && doc.Activate())
{
var page = doc.FindPage("PCB");
if (page.IsValid() && doc.SelectPage(page))
{
var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_TOPCOPPER);
if (layer.IsValid())
{
var d = 20;
var p1 = new DlxPoint(60, 100);
var p2 = new DlxPoint(100, 100);
var trackstyle = new DlxTrackStyle(1.8);
doc.SetStyle(trackstyle);
layer.DrawTrack(p1, p2);
layer.DrawTrack(p2, p2.OffsetY(-d), -180);
layer.DrawTrack(p2.OffsetY(-d), p2.OffsetY(-d*2));
layer.DrawTrack(p2.OffsetY(-d*2), p2.OffsetY(-d*3), 180);
layer.DrawTrack(p2.OffsetY(-d*3), p2.Offset(40, -d*3));
}
}
}
|