A linetype has description, scaling status, and pattern length properties that describe the linetype and
the set of properties that define the pattern. In the examples below, the pLinetype variable stores a pointer
to the linetype record object.
Description property
The description property stores arbitrary text that are comments for the linetype. The description can be
used as a comment or a series of underscores, dots, dashes, and spaces to show a representation of the linetype.
The description is an empty string by default.
To get the description, use the comments() method which does not have arguments and returns the description
as an OdString value. For example:
The pattern length specifies the total length in drawing units of all linetype dashes as a positive
double value. Embedded shapes or text strings do not add to the pattern length because they are overlaid
and do not interrupt the actual dash pattern. The linetype object can automatically calculate the total
length when it adds new dashes. If the pattern length is set to zero, the linetype object recalculates
the pattern length as a sum of absolute length values of all dashes that form the linetype pattern. If the
pattern length is not zero, its actual value defines the pattern length. The pattern length is zero by default.
To get the pattern length, use the patternLength() method which does not have arguments and returns
the pattern length as a positive Double value. For example:
To set the pattern length, use the setPatternLength() method which requires one argument —
the length as a positive Double value — and does not return a value. For example:
pLinetype->setPatternLength(4.5);
Scaling Status
This property determines whether or not the alignment is scaled to fit. The linetype object defines this
property as a Boolean value which is True when the alignment is scaled to fit or False when the alignment
is not scaled to fit. The scaling status is False by default.
To check the scaling status, use the isScaledToFit() method which does not have arguments and returns the
status as a Boolean value. For example:
To switch the scaling status, use the setIsScaledToFit() method which requires one argument —
the status as a Boolean value — and does not return a value. For example:
pLinetype->setIsScaledToFit(true);
Note: The rendering device supports a scale property. The OdGiLinetype class uses the
scaling status of the linetype in the database.