Drawings SDK Developer Guide > Working with .dwg Files > Working with Databases > Working with Database Containers > Working with Dictionaries of Objects > Working with Specific Dictionaries > Multi-Line Styles Dictionary > Editing Multi-Line Style Caps
Editing Multi-Line Style Caps

The multi-line style object can have start and end caps which can have circular or linear shape, connect outer or inner elements, or be cut. In the following examples, the pMLStyle variable stores a pointer to the multi-line style object.

Start and End Square Caps

The property determines whether the multi-line has lines between the outermost elements on the caps as a Boolean value. If the value is True, the multi-line has caps of linear shape between its utmost elements. If the value is False, the multi-line does not have lines on caps. Square caps are False by default.

To check the start and end square caps, use the startSquareCap() and endSquareCap() methods which do not have arguments and return the corresponding status as a Boolean value. For example:


odPrintConsoleString(L"\nStart square caps is %s", (pMLStyle->startSquareCap()) ? L"On" : L"Off");
odPrintConsoleString(L"\nEnd square caps is %s", (pMLStyle->endSquareCap()) ? L"On" : L"Off");

To switch the start and end square caps, use the setStartSquareCap() and setEndSquareCap() methods which require a Boolean value and do not return a value. For example:


// Assign the line on the start cap
pMLStyle->setStartSquareCap(true);

// Assign the line on the end cap
pMLStyle->setEndSquareCap(true);

// Remove the line from the start cap
pMLStyle->setStartSquareCap(false);

// Remove the line from the end cap
pMLStyle->setEndSquareCap(false);

Start and End Outer Round Caps

The property determines whether a multi-line has arcs between the outermost elements on the caps as a Boolean value. If the value is True, the multi-line has caps of circular shape between utmost elements. If the value is False, the multi-line does not have outer arcs on caps. Outer round caps are False by default.

To check the start and end outer round caps, use the startRoundCap() and endRoundCap() methods which do not have arguments and return the corresponding status as a Boolean value. For example:


odPrintConsoleString(L"\nStart outer round caps is %s", (pMLStyle->startRoundCap()) ? L"On" : L"Off");
odPrintConsoleString(L"\nEnd outer round caps is %s", (pMLStyle->endRoundCap()) ? L"On" : L"Off");

To switch the start and end outer round caps, use the setStartRoundCap() and setEndRoundCap() methods which require a Boolean value and do not return a value. For example:


// Assign the outer arc on the start cap
pMLStyle->setStartRoundCap(true);

// Assign the outer arc on the end cap
pMLStyle->setEndRoundCap(true);

// Remove the outer arc from the start cap
pMLStyle->setStartRoundCap(false);

// Remove the outer arc from the end cap
pMLStyle->setEndRoundCap(false);

Start and End Inner Round Caps

The property determines whether a multi-line has arcs between pairs of inner elements on caps as a Boolean value. If the value is True, the multi-line has caps of circular shape between inner elements. If the value is False, the multi-line does not have inner arcs on caps. Inner round caps are False by default.

If a multi-line style contains an odd number of elements, the base line is unconnected. For example, if there are seven elements, inner arcs connect elements 2 and 6 and elements 3 and 5, and element 4 is left unconnected. If a multi-line style contains an even number of elements, all inner elements are connected. For example, if there are eight elements, inner arcs connect elements 2 and 7, elements 3 and 6, and elements 4 and 5.

To check for start and end inner round caps, use the startInnerArcs() and endInnerArcs() methods which do not have arguments and return the corresponding status as a Boolean value. For example:


odPrintConsoleString(L"\nStart inner round caps is %s", (pMLStyle->startInnerArcs()) ? L"On" : L"Off");
odPrintConsoleString(L"\nEnd inner round caps is %s", (pMLStyle->endInnerArcs()) ? L"On" : L"Off");

To switch the start and end inner round caps, use the setStartInnerArcs() and setEndInnerArcs() methods which require a Boolean value and do not return a value. For example:


// Assign the inner arcs on the start cap
pMLStyle->setStartInnerArcs(true);

// Assign the inner arcs on the end cap
pMLStyle->setEndInnerArcs(true);

// Remove the inner arcs from the start cap
pMLStyle->setStartInnerArcs(false);

// Remove the inner arcs from the end cap
pMLStyle->setEndInnerArcs(false);

Start and End Angle Caps

The property defines the angle in radians on which the multi-line cuts its own elements on caps as a Double value. The correct value is found in the range 1/18 PI (10º) to 17/18 PI (170º). The angle PI/2 (90º) cuts the elements perpendicular to the direction of the first or last segment appropriately. The angle from 1/18 PI to 1/2 PI radians cuts the elements with negative offset. The angle from 1/2 PI to 17/18 PI radians cuts the elements with positive offset. The angle caps are PI/2 by default.

To get the start and end angles, use the startAngle() and endAngle() methods which do not have arguments and return the corresponding angle as a Double value. For example:


odPrintConsoleString(L"\nStart angle = %g", pMLStyle->startAngle());
odPrintConsoleString(L"\nEnd angle = %g", pMLStyle->endAngle());

To set the start and end angles, use the setStartAngle() and setEndAngle() methods which require a Double value as an argument and do not return a value. For example:


// Set the start angle
pMLStyle->setStartAngle(0.7854);

// Set the end angle
pMLStyle->setEndAngle(2.3562);

Note: The setStartAngle() and setEndAngle() methods do not convert to an equivalent angle and set the specified value.

See Also

Working with Multi-Line Styles

Specific Multi-Line Style Properties

Editing Multi-Line Style Elements

Example of Working with the Multi-Line Style Object

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.