Drawings SDK Developer Guide > Working with .dwg Files > Working with Databases > Working with Database Containers > Working with Predefined Tables of Named Records > Working with Specific Predefined Tables of Named Records > Linetypes Table > Specific Properties of Linetypes
Specific Properties of Linetypes

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:


odPrintConsoleString(L"\nDescription: %s", pLinetype->comments().c_str());

To set the description, use the setComments() method which requires one argument — an OdString value — and does not return a value. For example:


OdString sDesc = L"Dash Dot _ . _ . _";
pLinetype->setComments(sDesc);

Pattern Length

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:


odPrintConsoleString(L"\nPattern Length = %f", pLinetype->patternLength());

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:


odPrintConsoleString(L"\nLinetype %s scaled to fit", (pLinetype->isScaledToFit()) ? L"is" : L"is not");

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.

See Also

Working with Linetypes

Working with the Linetype Pattern

Example of Working with the Linetype Record Object

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