Sets the color of Probe objects.

syntaxSyntax:
DlxProbeStyle.SetColor(name)
DlxProbeStyle.SetColor(handle)
DlxProbeStyle.SetColor(style)

Parameters

Parameter Description
name A string containing the name of the color.
handle A string containing the handle of the color.
style A DlxColor object that specifies the color.

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 probestyle = new DlxProbeStyle(0.5, 15, "blue", "Pin Text");
      doc.SetStyle(probestyle);
      layer.DrawProbe(new DlxPoint(50,50), "A1", DlxApp.PROBEVALUETYPE_REAL, 1, DlxApp.PROBEANALYSIS_ALL);
      probestyle.SetColor("green");
      doc.SetStyle(probestyle);
      layer.DrawProbe(new DlxPoint(60,50), "A2", DlxApp.PROBEVALUETYPE_REAL, 1, DlxApp.PROBEANALYSIS_ALL);
    }
  }
}

See also