Gets the shape of the corners of the rectangle.

syntaxSyntax:
DlxRectangle.GetCornerType(index)

Parameters

Parameter Description
index Specify the corner index. Specify one of the following values:
DlxApp.CORNERINDEX_BOTTOMLEFT
DlxApp.CORNERINDEX_BOTTOMRIGHT
DlxApp.CORNERINDEX_TOPRIGHT
DlxApp.CORNERINDEX_TOPLEFT

Return Value

Returns the type of the specified corner. Returns one of the following values:

Value Meaning
DlxApp.CORNERTYPE_ROUNDED
DlxApp.CORNERTYPE_BEVELED
DlxApp.CORNERTYPE_SCALLOPED

Example

  Copy codeCopy 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())
    {
      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));
    }
  }
}

See also