Sets the cap style for this pen object.

syntaxSyntax:
DlxPenStyle.SetCaps(startCap, endCap)

Parameters

Parameter Description
startCap A string containing the name of the start cap or its handle.
endCap A string containing the name of the end cap or its handle.

Return Value

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

Remarks

For the start and end line caps use one of the values listed below:

HandleName
DlxApp.PENCAP_ROUNDRound
DlxApp.PENCAP_FLATFlat
DlxApp.PENCAP_SQUARESquare
DlxApp.PENCAP_TRIANGULARTriangular
DlxApp.PENCAP_OPENARROWOpen arrow
DlxApp.PENCAP_EMPTYARROWEmpty arrow
DlxApp.PENCAP_SOLIDARROWSolid arrow
DlxApp.PENCAP_EMPTYCONCAVEARROWEmpty concave arrow
DlxApp.PENCAP_SOLIDCONCAVEARROWSolid concave arrow
DlxApp.PENCAP_EMPTYSHARPARROWEmpty sharp arrow
DlxApp.PENCAP_SOLIDSHARPARROWSolid sharp arrow
DlxApp.PENCAP_DOUBLEOPENARROWDouble open arrow
DlxApp.PENCAP_CLOSEDDOUBLEARROWClosed double arrow
DlxApp.PENCAP_DOUBLESOLIDARROWDouble solid arrow
DlxApp.PENCAP_SLASHSlash
DlxApp.PENCAP_LEFTSLASHLeft slash
DlxApp.PENCAP_RIGHTSLASHRight slash
DlxApp.PENCAP_CROSSSLASHCross slash
DlxApp.PENCAP_EMPTYCIRCLEEmpty circle
DlxApp.PENCAP_SOLIDCIRCLESolid circle
DlxApp.PENCAP_EMPTYSQUAREEmpty square
DlxApp.PENCAP_SOLIDSQUARESolid square
DlxApp.PENCAP_EMPTYDIAMONDEmpty diamond
DlxApp.PENCAP_SOLIDDIAMONDSolid diamond
DlxApp.PENCAP_OPENARROWINVERTEDOpen arrow inverted
DlxApp.PENCAP_EMPTYARROWINVERTEDEmpty arrow inverted
DlxApp.PENCAP_SOLIDARROWINVERTEDSolid arrow inverted

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 pen = new DlxPenStyle(0.5, new DlxColor("orangered"), "DASHED");
      doc.SetStyle(pen);
      layer.DrawLine(new DlxPoint(30, 30), new DlxPoint(80, 80));
      pen.SetCaps("round", "open arrow");
      doc.SetStyle(pen);
      layer.DrawLine(new DlxPoint(40, 30), new DlxPoint(90, 80));
    }
  }
}

See also