Sets the shadow style.

syntaxSyntax:
DlxDimensionStyle.SetStyle(name)
DlxDimensionStyle.SetStyle(handle)
DlxDimensionStyle.SetStyle(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.

Return Value

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

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 dimstyle = new DlxDimensionStyle(DlxApp.STYLE_DEFAULT);
      doc.SetStyle(dimstyle);
      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);

      dimstyle.SetStyle("Diagram Measurements");
      doc.SetStyle(dimstyle);
      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