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())
{
var bestyle = new DlxBusentryStyle(5, 5, 5, new DlxPenStyle(0.2, "red"), "Pin Text", 0.5, 0.1);
doc.SetStyle(bestyle);
layer.DrawBusentry(new DlxPoint(100,120), "red", DlxApp.BUSENTRYDIR_BOTTOMRIGHT);
bestyle.SetStyle(5, 5, 5, new DlxPenStyle(0.2, "green"), "Pin Text", 0.5, 0.1);
doc.SetStyle(bestyle);
layer.DrawBusentry(new DlxPoint(100,115), "green", DlxApp.BUSENTRYDIR_BOTTOMRIGHT);
bestyle.SetStyle(5, 5, 5, new DlxPenStyle(0.2, "blue"), "Pin Text", 0.5, 0.1);
doc.SetStyle(bestyle);
layer.DrawBusentry(new DlxPoint(100,110), "blue", DlxApp.BUSENTRYDIR_BOTTOMRIGHT);
var busstyle = new DlxBusStyle(1.5, DlxApp.STYLE_NULL, "darkblue");
doc.SetStyle(busstyle);
layer.DrawBus(new DlxPoint(50,50), new DlxPoint(100,50), true);
layer.DrawBus(new DlxPoint(100,50), new DlxPoint(100,150), true);
}
}
}
|