Constructs a DlxDimensionStyle object.

syntaxSyntax:
new DlxDimensionStyle()
new DlxDimensionStyle(name)
new DlxDimensionStyle(handle)
new DlxDimensionStyle(style)

Parameters

Parameter Description
name A string containing the name of the style.
handle A string containing the handle of the style.
style A DlxDimensionStyle object from which to copy the style.

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 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 defaultdimstyle = new DlxDimensionStyle(DlxApp.STYLE_DEFAULT);
      doc.SetStyle(defaultdimstyle);
      var p1 = new DlxPoint(50, 50);
      var p2 = new DlxPoint(100, 100);
      doc.SetStyle(new DlxPenStyle(0.3,"Red"));
      layer.DrawLine(p1, p2);
      layer.DrawAlignedDimension(p1, p2, 10);

      var diagramdimstyle = new DlxDimensionStyle("Diagram Measurements");
      doc.SetStyle(diagramdimstyle);
      var q1 = new DlxPoint(80, 50);
      var q2 = new DlxPoint(130, 100);
      doc.SetStyle(new DlxPenStyle(0.3,"blue"));
      layer.DrawLine(q1, q2);
      layer.DrawAlignedDimension(q1, q2, 10);      
    }
  }
}

See also