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 > Specific Multi-Line Style Properties
Specific Multi-Line Style Properties

The multi-line style object uses internal name, description, miter status, fill status, and fill color properties that are specific to multi-line styles. In the following examples, the pMLStyle variable stores a pointer to the multi-line style object.

Name

The property defines the multi-line style name as a non-empty String value up to 32 letters long. The stored name is internal. The name is an empty string by default.

To get the internal name, use the name() method which does not have arguments and returns the OdString value. For example:


OdString name = pMLStyle->name();
odPrintConsoleString(L"\nName = \"%s\"", name.c_str());

To set the internal name, use the setName() method which requires an OdString value as an argument and does not return a value. For example:


pMLStyle->setName(L"MLStyle");

Note: The internal name must coincide with the external name stored in the dictionary.

Description

The property stores arbitrary text as a String value which is the comment for the multi-line style. The description is an empty string by default.

To get the description, use the description() method which does not have arguments and returns the OdString value. For example:


OdString comment = pMLStyle->description();
odPrintConsoleString(L"\nDescription = \"%s\"", comment.c_str());

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


pMLStyle->setDescription(L"way with centre mall");

Miter Status

The property determines whether miters are displayed as a Boolean value. If the value is True, miters are showed. If the value is False, miters are hidden. The miters status is False by default.

To check the miter status, use the showMiters() method which does not have arguments and returns the status as a Boolean value. For example:


odPrintConsoleString(L"\nMiters are %s", (pMLStyle->showMiters()) ? L"showed" : L"hidden");

To switch the miter status, use the setShowMiters() method which requires a Boolean value and does not return a value. For example:


// Show the miters
pMLStyle->setShowMiters(true);

// Hide the miters
pMLStyle->setShowMiters(false);

Fill Status

The property determines whether the space between lines is filled using the fill color as a Boolean value. If the value is True, the multi-line is filled inside using the fill color. If the value is False, the multi-line is transparent between lines. The fill status is False by default.

To check the fill status, use the filled() method which does not have arguments and returns the status as a Boolean value. For example:


odPrintConsoleString(L"\nSpace between lines is %s", (pMLStyle->filled()) ? L"filled" : L"limpid");

To switch the fill status, use the setFilled() method which requires a Boolean value and does not return a value. For example:


// Make the multi-line filled
pMLStyle->setFilled(true);

// Make the multi-line limpid
pMLStyle->setFilled(false);

Fill Color

The property defines the color to be used for filling the space between lines when the Fill Status property is True. If the Fill Status property is False, the Fill Color property is ignored. The fill color is OdCmEntityColor::kByLayer by default.

To get the fill color, use the fillColor() method which returns the OdCmColor instance. To check the color definition, use the colorMethod() method of the color object. For example:


OdCmColor color = pMLStyle->fillColor();

switch(color.colorMethod())
{
  case OdCmEntityColor::kByColor:
    odPrintConsoleString(L"RGB-Color = (%d,%d,%d)", color.red(), color.green(), color.blue());
    break;
  case OdCmEntityColor::kByACI:
    odPrintConsoleString(L"Color index = %d", color.colorIndex());
    break;
  case OdCmEntityColor::kForeground:
    odPrintConsoleString(L"Color is Black|White");
    break;
  case OdCmEntityColor::kByLayer:
    odPrintConsoleString(L"Color is byLayer");
    break;
  case OdCmEntityColor::kByBlock:
    odPrintConsoleString(L"Color is byBlock");
    break;
}

To set the fill color, use the setFillColor() method which requires the OdCmColor instance to be set as an argument and does not return a value. Before setting, initialize the color instance. For example:


// Set the color to (Red = 56, Green = 28, Blue = 14)
OdCmColor color1;
color1.setRGB(56, 28, 14);
pMLStyle->setFillColor(color1);

// Set the color to (Index = 16)
OdCmColor color2;
color2.setACI(16);
pMLStyle->setFillColor(color2);

Initializing all properties

The initMlineStyle() method sets all properties of the multi-line style object to their default values. For example:


pMLStyle->initMlineStyle();

Note: The initMlineStyle() method sets the internal name as an empty string, which can generate an invalid situation.

See Also

Working with Multi-Line Styles

Editing Multi-Line Style Caps

Editing Multi-Line Style Elements

Example of Working with the Multi-Line Style Object

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