Sets the cap style for this pen object.
Syntax: |
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:
Handle | Name |
DlxApp.PENCAP_ROUND | Round |
DlxApp.PENCAP_FLAT | Flat |
DlxApp.PENCAP_SQUARE | Square |
DlxApp.PENCAP_TRIANGULAR | Triangular |
DlxApp.PENCAP_OPENARROW | Open arrow |
DlxApp.PENCAP_EMPTYARROW | Empty arrow |
DlxApp.PENCAP_SOLIDARROW | Solid arrow |
DlxApp.PENCAP_EMPTYCONCAVEARROW | Empty concave arrow |
DlxApp.PENCAP_SOLIDCONCAVEARROW | Solid concave arrow |
DlxApp.PENCAP_EMPTYSHARPARROW | Empty sharp arrow |
DlxApp.PENCAP_SOLIDSHARPARROW | Solid sharp arrow |
DlxApp.PENCAP_DOUBLEOPENARROW | Double open arrow |
DlxApp.PENCAP_CLOSEDDOUBLEARROW | Closed double arrow |
DlxApp.PENCAP_DOUBLESOLIDARROW | Double solid arrow |
DlxApp.PENCAP_SLASH | Slash |
DlxApp.PENCAP_LEFTSLASH | Left slash |
DlxApp.PENCAP_RIGHTSLASH | Right slash |
DlxApp.PENCAP_CROSSSLASH | Cross slash |
DlxApp.PENCAP_EMPTYCIRCLE | Empty circle |
DlxApp.PENCAP_SOLIDCIRCLE | Solid circle |
DlxApp.PENCAP_EMPTYSQUARE | Empty square |
DlxApp.PENCAP_SOLIDSQUARE | Solid square |
DlxApp.PENCAP_EMPTYDIAMOND | Empty diamond |
DlxApp.PENCAP_SOLIDDIAMOND | Solid diamond |
DlxApp.PENCAP_OPENARROWINVERTED | Open arrow inverted |
DlxApp.PENCAP_EMPTYARROWINVERTED | Empty arrow inverted |
DlxApp.PENCAP_SOLIDARROWINVERTED | Solid arrow inverted |
Example
|
Copy 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