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())
{
doc.SetStyle(new DlxPenStyle(0.5, "orange"));
var obj = layer.DrawRectangle(new DlxRect(50,40,120,90), 0, 50, 0, 0, -50);
DlxApp.Printf("BL corner: %s(%.1f)", obj.GetCornerType(DlxApp.CORNERINDEX_BOTTOMLEFT)==DlxApp.CORNERTYPE_BEVELED ? "BEVELED" :
obj.GetCornerType(DlxApp.CORNERINDEX_BOTTOMLEFT)==DlxApp.CORNERTYPE_SCALLOPED ? "SCALLOPED" : "ROUNDED",
obj.GetCornerFactor(DlxApp.CORNERINDEX_BOTTOMLEFT));
DlxApp.Printf("BR corner: %s(%.1f)", obj.GetCornerType(DlxApp.CORNERINDEX_BOTTOMRIGHT)==DlxApp.CORNERTYPE_BEVELED ? "BEVELED" :
obj.GetCornerType(DlxApp.CORNERINDEX_BOTTOMRIGHT)==DlxApp.CORNERTYPE_SCALLOPED ? "SCALLOPED" : "ROUNDED",
obj.GetCornerFactor(DlxApp.CORNERINDEX_BOTTOMRIGHT));
DlxApp.Printf("TL corner: %s(%.1f)", obj.GetCornerType(DlxApp.CORNERINDEX_TOPLEFT)==DlxApp.CORNERTYPE_BEVELED ? "BEVELED" :
obj.GetCornerType(DlxApp.CORNERINDEX_TOPLEFT)==DlxApp.CORNERTYPE_SCALLOPED ? "SCALLOPED" : "ROUNDED",
obj.GetCornerFactor(DlxApp.CORNERINDEX_TOPLEFT));
DlxApp.Printf("TR corner: %s(%.1f)", obj.GetCornerType(DlxApp.CORNERINDEX_TOPRIGHT)==DlxApp.CORNERTYPE_BEVELED ? "BEVELED" :
obj.GetCornerType(DlxApp.CORNERINDEX_TOPRIGHT)==DlxApp.CORNERTYPE_SCALLOPED ? "SCALLOPED" : "ROUNDED",
obj.GetCornerFactor(DlxApp.CORNERINDEX_TOPRIGHT));
}
}
}
|