Set the size of the label attached to the leader.

syntaxSyntax:
DlxLeader.SetLabelShape(width, height, round)

Parameters

Parameter Description
width The width of the text label or one of the following values:
DlxApp.LEADERVALUE_AUTO The width of the text label is calculated automatically.
DlxApp.LEADERVALUE_BYSTYLE The width of the text label is taken from the style.
height The height of the text label or one of the following values:
DlxApp.LEADERVALUE_AUTO The height of the text label is calculated automatically.
DlxApp.LEADERVALUE_BYSTYLE The height of the text label is taken from the style.
round The rounding percentage of the label corners. Values between 0 and 100. The value of 0% indicates that the corners of the label are at 90°. Specify DlxApp.LEADERVALUE_BYSTYLE if the label corner rounding value is to be taken from the style.

Return Value

If the operation ends correctly it returns true otherwise it returns false.

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())
    {
      var style = new DlxLeaderStyle("diagram measurements");
      doc.SetStyle(style);
      var vertices = new Array();
      vertices[0] = new DlxPoint(30,30);
      vertices[1] = new DlxPoint(50,50);
      vertices[2] = new DlxPoint(70,50);
      var obj = layer.DrawLeader(vertices, "Hello, World."); 

      obj.SetLabelShape(20, 20, 100);
      obj.SetText(obj.GetText() + "\nHello, World.");
    }
  }
}

See also