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 > Example of Working with the Multi-Line Style Object
Example of Working with the Multi-Line Style Object

This example demonstrates displaying and modifying the properties of a multi-line style object. This example uses a console menu that represents the following operations: displaying the list of elements [L], adding a new element [A], setting properties of an existing element by index [S], removing an existing element by index [R]; getting and setting the fill status [F], fill color [C], miter status [M], start angle cap [1], start square cap [2], start outer round cap [3], start inner round cap [4], end angle cap [5], end square cap [6], end outer round cap [7], end inner round cap [8], and description [D]; displaying the common object properties, general entity properties, and specific multi-line style properties [P]; and modifying the general entity properties [M].

The example uses the following header files, examples, and functions implemented in them:


#include "..\Common\DemoMain.h"
#include "DbMlineStyle.h"
#include <iostream>
using namespace std;

// Example of Entering and Displaying for Color Objects
OdString AboutColor(OdCmColor color);
bool EntryColorValue(OdCmColor& refColor, bool isAnyMethod = true);

// Example of Using the Record–Table and Dictionary Interfaces for Getting Information about Objects
OdString AboutObjectKey(OdDbObject* pObject);
OdString AboutDbObject(OdDbObjectId idObject);

// Example of Using the Record–Table Interface for Selecting Objects
OdDbObjectId EntryTableRecordObject(OdDbObjectId idTable, OdDbObjectId idRecord = OdDbObjectId::kNull);

// Example of Entering Characters for String Objects
OdString EntryTextAs(enum enumCheckText = kArbitrary);

void PrintObjectProperties(OdDbObject* pObject);

The PrintMLStyleProperties() function requires a pointer to an existing multi-line style object and displays its properties. The function gets the specific properties using the name(), numElements(), fillColor(), filled(), showMiters(), startAngle(), startSquareCap(), startRoundCap(), startInnerArcs(), endAngle(), endSquareCap(), endRoundCap(), endInnerArcs(), and description() methods. The function uses the AboutColor() function for converting the fill color to a string value. The AboutColor() function requires an instance of the OdCmColor object as an argument and returns a string containing the color properties. The function uses the AboutObjectKey() function for getting the multi-line style external name, that is, the key in the dictionary.

The PrintMLStyleProperties() function has the following implementation:


void PrintMLStyleProperties(OdDbMlineStyle* pMLStyle)
{
  wcout << L"\n  Key = <" << AboutObjectKey(pMLStyle) << ">"
        << L"\n  Name = \"" << pMLStyle->name() << L"\""
        << L"\n  Elements = " << pMLStyle->numElements()
        << L"\n  Fill color = " << AboutColor(pMLStyle->fillColor())
        << L"\n  Fill status = " << ((pMLStyle->filled()) ? L"On" : L"Off")
        << L"\n  Miter status = " << ((pMLStyle->showMiters()) ? L"On" : L"Off")
        << L"\n  Start angle cap = " << pMLStyle->startAngle() << L" radians"
        << L"\n  Start square cap = " << ((pMLStyle->startSquareCap()) ? L"On" : L"Off")
        << L"\n  Start outer round cap = " << ((pMLStyle->startRoundCap()) ? L"On" : L"Off")
        << L"\n  Start inner round cap = " << ((pMLStyle->startInnerArcs()) ? L"On" : L"Off")
        << L"\n  End angle cap = " << pMLStyle->endAngle() << L" radians"
        << L"\n  End square cap = " << ((pMLStyle->endSquareCap()) ? L"On" : L"Off")
        << L"\n  End outer round cap = " << ((pMLStyle->endRoundCap()) ? L"On" : L"Off")
        << L"\n  End inner round cap = " << ((pMLStyle->endInnerArcs()) ? L"On" : L"Off")
        << L"\n  Description = \"" << pMLStyle->description() << L"\"";
}

The ModifyMLStyleProperties() function requires a pointer to an existing multi-line style object and implements the console menu for the listed operations. The function organizes a loop that inquires about the operation code and uses the switch statement to select whether the case must be performed. The function processes user actions in the loop until the user selects the [Q] operation. The function uses the EntryColor() function for entering a color value, AboutColor() function for displaying the color properties, EntryTableRecordObject() function for selecting and entering a linetype record object, AboutDbObject() function for displaying the properties of the linetype record object associated with the multi-line style element, and the EntryTextAs() function for entering a string.

When the user selects [L], the function prints the list of elements for the multi-line style. The function gets the number of elements using the numElements() method. If this number is non-zero, the function organizes a loop that gets the offset, color, and linetype for each element of the multi-line style using the getElementAt() method and displays their values using the appropriate AboutColor() and AboutDbObject() functions.

When the user selects [P], the function displays the common object properties using the PrintObjectProperties() function, specific properties of the specified multi-line style object using the PrintMLStyleProperties() function, and prints the list of elements using the [L] operation. When the user selects the [p] operation, the function displays only specific multi-line style properties.

When the user selects [D], the function gets the comments using the description() method and requests an arbitrary string for new comments using the EntryTextAs() function; this function organizes the entry of a string and returns the entered value as the OdString instance. After entry, the function sets the obtained string as the new comment using the setDescription() method.

When the user selects [C], the function gets the current fill color as an OdCmColor instance using the fillColor() method and calls the EntryColorValue() function, passing to it the color instance. The EntryColorValue() function organizes a console menu for specifying the red, green, and blue color components or color index; the function returns True if the user modifies the color instance or False if the user cancels entry. The EntryColorValue() function passes the modified color instance through its own argument. If entry is successful, the ModifyMLStyleProperties() function sets the new fill color using the setFillColor() method and calls the AboutColor() function for displaying information about the specified color.

When the user selects [F] or [M], the function requests the fill status or miter status and prompts: N-on or F-off. The function calls the appropriate setFilled() method or setShowMiters() method and passes to it a True value if the user enters 'N' or a False value if the user enters 'F'. After setting, the function checks and displays the fill status or miter status using the filled() or showMiters() method appropriately.

When the user selects [1] or [5], the function gets the current start angle or end angle using the appropriate startAngle() or endAngle() method and prompts for a double value in the range 1/18 PI to 17/18 PI. If an entered value is incorrect, the function displays an error message and breaks to the console menu. If an entered value is correct, the function sets the new start or end angle using the setStartAngle() or setEndAngle() method appropriately.

When the user selects [2], [3], [4], [6], [7], or [8], the function requests the cap status for the start square cap, start outer round cap, start inner round cap, end square cap, end outer round cap, end inner round cap, and prompts: N-on or F-off. The function calls the appropriate setStartSquareCap(), setStartRoundCap(), setStartInnerArcs(), setEndSquareCap(), setEndRoundCap(), or setEndInnerArcs() method and passes to it a True value if the user enters 'N' (status is on) or a False value if the user enters 'F' (status is off). After setting, the function checks and displays the corresponding cap status using the startSquareCap(), startRoundCap(), startInnerArcs(), endSquareCap(), endRoundCap(), or endInnerArcs() method appropriately.

When the user selects [A], the function sequentially requests the offset, color, and linetype for a new element. If the entered offset value is incorrect, the function breaks to the console menu. To enter a color, the function calls the EntryColorValue() function and passes to it the initialized color instance kByLayer value by default as an argument. If the user cancels color entry, the function breaks to the console menu. To enter a linetype, the function calls the EntryTableRecordObject() function and passes to it the object ID of the linetype table object as an argument. The function gets the linetype table object using the getLinetypeTableId() method of the database object which it obtains from the multi-line style object using its database() method. If the user cancels the linetype entry or if the ID is kNull, the function breaks to the console menu. If all three entries are successful, the function calls the addElement() method and passes to it the double value of the offset as the first argument, OdCmColor instance as the second argument, OdDbObjectId instance of the linetype record object as the third argument, and displays the list of elements using the [L] operation. When the user selects the [a] operation, the function requests only the offset, initializes the color to the kForeground value, obtains the object ID of the "Continuous" linetype using the getLinetypeContinuousId() method of the database object, calls the addElement() method, and goes to the [L] operation.

When the user selects [R], the function requests the element index to be deleted. If the entered index is incorrect or out of range, the function displays an error message and breaks to the console menu. If an entered index is correct, the function calls the removeElementAt() method and passes to it the index. Then the function displays the list of elements using the [L] operation.

When the user selects [S], the function first requests the element index to be modified. If the entered index is incorrect or out of range, the function displays an error message and breaks to the console menu. If an entered index is correct, the function calls the getElementAt() method and passes to it the index and three variables for offset, color, and linetype for getting the current element properties. After that, the function sequentially requests the new offset, color, and linetype for the selected element (the same as the [A] operation). If all three entries are successful, the function calls the setElement() method and passes to it the index and new values of the offset, color, and linetype.

The ModifyMLStyleProperties() function has the following implementation:


#define ANGLE_MIN OdaPI/18.0
#define ANGLE_MAX OdaPI/18.0*17.0

void ModifyMLStyleProperties(OdDbMlineStyle* pMLStyle)
{
  wchar_t ch = L'\0';
  double value;
  OdInt16 index, count;
  OdString comment;
  OdCmColor color;
  OdDbObjectId idLT;

  wcout << L"\nStart modifying of the multi-line style properties";    
  do {
    switch(ch)
    {
      case L'P':          // Print the whole properties
        wcout << L"\nH=" << pMLStyle->handle().ascii();
        wcout << L"\n  ------ Common Object Properties";
        PrintObjectProperties(pMLStyle);


      case L'p':          // Print the specific properties
        wcout << L"\n  ------ Specific Multi-Line Style Properties";
        PrintMLStyleProperties(pMLStyle);
 
 
      case L'L':          // Print the list of elements
      case L'l':
        wcout << L"\n  ------ Multi-Line Style Elements";
        if((count = pMLStyle->numElements()) == 0)
          wcout << L"\n  List is empty";
        else
          for(index = 0 ; index < count ; index++)
          {
            pMLStyle->getElementAt(index, value, color, idLT);
            wcout << L"\n  " << index << L". Offset=" << value
                  << L", Color=" << AboutColor(color)
                  << L", " << AboutDbObject(idLT);
          }
        wcout << L"\n";
        break;

                          // Add a new element in the style
      case L'A':
        wcout << L"\nEntry an offset for new element:>";
        wcin >> value;

        if(!wcin.fail() && wcin.peek() == 10)
        {
          wcout << L"\nEntry a color for new element:>";
          color.setColorMethod(OdCmEntityColor::kByLayer);

          if(EntryColorValue(color, true))
          {
            wcout << L"\nSelect a linetype for new element:>";
            idLT = EntryTableRecordObject(pMLStyle->database()->getLinetypeTableId());

            if(!idLT.isNull())
            {
              pMLStyle->addElement(value, color, idLT);
              ch = L'L';
              continue;
            }
          }
        }
        else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered value\n"; }
        break;

                          // Add an element by offset in the style
      case L'a':
        wcout << L"\nEntry an offset for new element:>";
        wcin >> value;

        if(!wcin.fail() && wcin.peek() == 10)
        {
          color.setColorMethod(OdCmEntityColor::kForeground);
          idLT = pMLStyle->database()->getLinetypeContinuousId();

          pMLStyle->addElement(value, color, idLT);
          ch = L'L';
          continue;
        }
        else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered value\n"; }
        break;


      case L'R':          // Remove an existing element from the style
      case L'r':
        count = pMLStyle->numElements()-1;
        wcout << L"Entry the element index [0..." << count << L"]:>";
        wcin >> index;

        if(!wcin.fail() && wcin.peek() == 10)
        {
          if(index >= 0 && index <= count)
          {
            pMLStyle->removeElementAt(index);
            ch = L'L';
            continue;
          }
          else wcout << L"Error: Index outs the range\n";
        }
        else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered value\n"; }
        break;


      case L'S':          // Set the element properties in the style
      case L's':
        count = pMLStyle->numElements()-1;
        wcout << L"Entry the element index [0..." << count << L"]:>";
        wcin >> index;

        if(!wcin.fail() && wcin.peek() == 10)
        {
          if(index >= 0 && index <= count)
          {
            pMLStyle->getElementAt(index, value, color, idLT);

            wcout << L"\nCurrent offset = " << value
                  << L"\nEntry a new offset:>";
            wcin >> value;

            if(!wcin.fail() && wcin.peek() == 10)
            {
              wcout << L"\nCurrent color = " << AboutColor(color);
              if(EntryColorValue(color, true))
              {
                wcout << L"\nCurrent linetype = " << AboutDbObject(idLT);
                idLT = EntryTableRecordObject(pMLStyle->database()->getLinetypeTableId(), idLT);

                if(!idLT.isNull())
                {
                  pMLStyle->setElement(index, value, color, idLT);

                  pMLStyle->getElementAt(index, value, color, idLT);
                  wcout << L"\nElement " << index << L": Offset=" << value
                        << L", " << AboutColor(color)
                        << L", " << AboutDbObject(idLT);
                }
              }
            }
            else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered offset\n"; }
          }
          else wcout << L"Error: Index outs the range\n";
        }
        else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered index\n"; }
        break;


      case L'D':          // Set the description
      case L'd':
        wcout << L"\nDescription \"" << pMLStyle->description() << L"\"\nDescription:>";

        if((comment = EntryTextAs(kArbitrary)).isEmpty()) break;

        pMLStyle->setDescription(comment);
        break;


      case L'C':          // Set the fill color
      case L'c':
        color = pMLStyle->fillColor();
        if(EntryColorValue(color, true))
        {
          pMLStyle->setFillColor(color);
          wcout << L"Fill color is set to: " << AboutColor(pMLStyle->fillColor()) << L"\n";
        }
        break;

      
      case L'F':          // Set the fill status 
      case L'f':
        wcout << "\nSet the filled status [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setFilled(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setFilled(false);

        wcout << L"Filled status is set to: " << ((pMLStyle->filled()) ? L"On" : L"Off") << L"\n";
        break;


      case L'M':          // Set the miter status 
      case L'm':
        wcout << "\nSet the miter status [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setShowMiters(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setShowMiters(false);

        wcout << L"Miter status is set to: " << ((pMLStyle->showMiters()) ? L"On" : L"Off") << L"\n";
        break;

                          // Set the start angle cap
      case L'1':
        wcout << L"\nCurrent start angle cap = " << pMLStyle->startAngle()
              << L"\nEntry a new angle [1/18 PI to 17/18 PI]:>";
        wcin >> value;

        if(!wcin.fail() && wcin.peek() == 10)
        {
          if(value > ANGLE_MIN && value < ANGLE_MAX)
          {
            pMLStyle->setStartAngle(value);
            wcout << L"Start angle cap is set to: " << pMLStyle->startAngle() << L" radians\n";
          }
          else wcout << L"Error: Angle outs the range\n";
        }
        else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered value\n"; }
        break;

                          // Set the start square cap
      case L'2':
        wcout << "\nSet the start square cap [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setStartSquareCap(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setStartSquareCap(false);

        wcout << L"Start square cap is set to: " << ((pMLStyle->startSquareCap()) ? L"On" : L"Off") << L"\n";
        break;

                          // Set the start outer round cap
      case L'3':
        wcout << "\nSet the start outer round cap [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setStartRoundCap(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setStartRoundCap(false);

        wcout << L"Start outer round cap is set to: " << ((pMLStyle->startRoundCap()) ? L"On" : L"Off") << L"\n";
        break;

                          // Set the start inner round cap
      case L'4':
        wcout << "\nSet the start inner round cap [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setStartInnerArcs(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setStartInnerArcs(false);

        wcout << L"Start inner round cap is set to: " << ((pMLStyle->startInnerArcs()) ? L"On" : L"Off") << L"\n";
        break;

                          // Set the end angle cap
      case L'5':
        wcout << L"\nCurrent end angle cap = " << pMLStyle->endAngle()
              << L"\nEntry a new angle [1/18 PI to 17/18 PI]:>";
        wcin >> value;

        if(!wcin.fail() && wcin.peek() == 10)
        {
          if(value > ANGLE_MIN && value < ANGLE_MAX)
          {
            pMLStyle->setEndAngle(value);
            wcout << L"End angle cap is set to: " << pMLStyle->endAngle() << L" radians\n";
          }
          else wcout << L"Error: Angle outs the range\n";
        }
        else { wcin.clear();  wcin.sync();  wcout << L"Error: Invalid entered value\n"; }
        break;

                          // Set the end square cap
      case L'6':
        wcout << "\nSet the end square cap [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setEndSquareCap(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setEndSquareCap(false);

        wcout << L"End square cap is set to: " << ((pMLStyle->endSquareCap()) ? L"On" : L"Off") << L"\n";
        break;

                          // Set the end outer round cap
      case L'7':
        wcout << "\nSet the end outer round cap [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setEndRoundCap(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setEndRoundCap(false);

        wcout << L"End outer round cap is set to: " << ((pMLStyle->endRoundCap()) ? L"On" : L"Off") << L"\n";
        break;

                          // Set the end inner round cap
      case L'8':
        wcout << "\nSet the end inner round cap [N-on|F-off]:>";
        wcin >> ch;

        if(ch == L'N' || ch == L'n') pMLStyle->setEndInnerArcs(true);
        else if(ch == L'F' || ch == L'f') pMLStyle->setEndInnerArcs(false);

        wcout << L"End inner round cap is set to: " << ((pMLStyle->endInnerArcs()) ? L"On" : L"Off") << L"\n";
        break;


      case L'\0':         // Skip an action
        break;

      default:
        wcout << L"Error: Incorrect operation\n";
    }
    wcout << L"\nSelected multi-line style: \"" << pMLStyle->name() << L"\"";
    wcout << L"\nC. Set the fill color";
    wcout << L"\nF. Set the fill status";
    wcout << L"\nD. Set the description";
    wcout << L"\nM. Set the miter status";
    wcout << L"\n--------------------------------";
    wcout << L"\n1. Set the start angle cap";
    wcout << L"\n2. Set the start square cap";
    wcout << L"\n3. Set the start outer round cap";
    wcout << L"\n4. Set the start inner round cap";
    wcout << L"\n5. Set the end angle cap";
    wcout << L"\n6. Set the end square cap";
    wcout << L"\n7. Set the end outer round cap";
    wcout << L"\n8. Set the end inner round cap";
    wcout << L"\n--------------------------------";
    wcout << L"\nA. Add a new element";
    wcout << L"\na. Add an element by offset";
    wcout << L"\nR. Remove an existing element";
    wcout << L"\nS. Set the element properties";
    wcout << L"\nL. Print the list of elements";
    wcout << L"\nP. Print the whole properties";
    wcout << L"\np. Print the specific properties";
    wcout << L"\nQ. Quit";
    wcout << L"\nSelect operation:>";
    wcin >> ch;
  }
  while(ch != L'Q' && ch != L'q');

  wcout << L"Stop modifying of the multi-line style properties\n";
}

Testing gives the following results:


Start modifying of the multi-line style properties

Selected multi-line style: "MLStyle"
C. Set the fill color
F. Set the fill status
D. Set the description
M. Set the miter status
--------------------------------
1. Set the start angle cap
2. Set the start square cap
3. Set the start outer round cap
4. Set the start inner round cap
5. Set the end angle cap
6. Set the end square cap
7. Set the end outer round cap
8. Set the end inner round cap
--------------------------------
A. Add a new element
a. Add an element by offset
R. Remove an existing element
S. Set the element properties
L. Print the list of elements
P. Print the whole properties
p. Print the specific properties
Q. Quit
Select operation:>

When the operation is p-"Print the specific properties":


------ Specific Multi-Line Style Properties
Key = <MLStyle>
Name = "MLStyle"
Elements = 0
Fill color = [byLayer]
Fill status = Off
Miter status = Off
Start angle cap = 1.5708 radians
Start square cap = Off
Start outer round cap = Off
Start inner round cap = Off
End angle cap = 1.5708 radians
End square cap = Off
End outer round cap = Off
End inner round cap = Off
Description = ""
------ Multi-Line Style Elements
List is empty

When the operation is D-"Set the description":


Description ""
Description:>way with centre mall

When the operation is M-"Set the miter status":


Set the miter status [N-on|F-off]:>N
Miter status is set to: On

When the operation is F-"Set the fill status":


Set the filled status [N-on|F-off]:>N
Filled status is set to: On

When the operation is C-"Set the fill color":


Start modifying of the color properties
Current color value: [c0000000] = [byLayer]
M. Set the color method
N. Set the color and book names
L. Clear the color names
I. Entry the color INDEX
R. Entry the RED color component
G. Entry the GREEN color component
B. Entry the BLUE color component
P. Print the specific properties
Q. Quit without saving
S. Save and Exit
Select operation:>R

Entry the RED component value [0...255]:>32
Current color value: [c2200000] = [byRGB(32,0,0)]

Select operation:>G

Entry the GREEN component value [0...255]:>16
Current color value: [c2201000] = [byRGB(32,16,0)]

Select operation:>B

Entry the BLUE component value [0...255]:>8
Current color value: [c2201008] = [byRGB(32,16,8)]

Select operation:>S
Stop modifying of the color properties
Fill color is set to: [byRGB(32,16,8)]

When the operation is 1-"Set the start angle cap":


Current start angle cap = 1.5708
Entry a new angle [1/18 PI to 17/18 PI]:>5.678
Error: Angle outs the range

When the operation is 5-"Set the end angle cap":


Current end angle cap = 1.5708
Entry a new angle [1/18 PI to 17/18 PI]:>2.356194
End angle cap is set to: 2.35619 radians

When the operation is 1-"Set the start angle cap":


Current start angle cap = 1.5708
Entry a new angle [1/18 PI to 17/18 PI]:>0.785398
Start angle cap is set to: 0.785398 radians

When the operation is 6-"Set the end square cap":


Set the end square cap [N-on|F-off]:>N
End square cap is set to: On

When the operation is 3-"Set the start outer round cap":


Set the start outer round cap [N-on|F-off]:>N
Start outer round cap is set to: On

When the operation is 8-"Set the end inner round cap":


Set the end inner round cap [N-on|F-off]:>N
End inner round cap is set to: On

When the operation is 2-"Set the start square cap":


Set the start square cap [N-on|F-off]:>N
Start square cap is set to: On

When the operation is a-"Add an element by offset":


Entry an offset for new element:>0.1

------ Multi-Line Style Elements
0. Offset=0.1, Color=[Foreground], [16-"Continuous"-Linetype]

When the operation is A-"Add an element":


Entry an offset for new element:>0.5

Entry a color for new element:>
Start modifying of the color properties
Current color value: [c0000000] = [byLayer]
M. Set the color method
N. Set the color and book names
L. Clear the color names
I. Entry the color INDEX
R. Entry the RED color component
G. Entry the GREEN color component
B. Entry the BLUE color component
P. Print the specific properties
Q. Quit without saving
S. Save and Exit
Select operation:>I

Entry an index [1...255]:>34
Current color value: [c3000022] = [byACI=34]

Select operation:>S
Stop modifying of the color properties

Select a linetype for new element:>
Select the Linetype object:
14-"ByBlock"
15-"ByLayer"
16-"Continuous"
Current: [Db:kNull]
Entry the name to be selected (or [?]-null/[:]-quit):>byLayer

------ Multi-Line Style Elements
0. Offset=0.5, Color=[byACI=34], [15-"ByLayer"-Linetype]
1. Offset=0.1, Color=[Foreground], [16-"Continuous"-Linetype]

When the operation is a-"Add an element by offset":


Entry an offset for new element:>-0.5

------ Multi-Line Style Elements
0. Offset=0.5, Color=[byACI=34], [15-"ByLayer"-Linetype]
1. Offset=0.1, Color=[Foreground], [16-"Continuous"-Linetype]
2. Offset=-0.5, Color=[Foreground], [16-"Continuous"-Linetype]

When the operation is S-"Set the element properties":


Entry the element index [0...2]:>1

Current offset = 0.1
Entry a new offset:>0

Current color = [Foreground]
Start modifying of the color properties
Current color value: [c3000007] = [Foreground]
M. Set the color method
N. Set the color and book names
L. Clear the color names
I. Entry the color INDEX
R. Entry the RED color component
G. Entry the GREEN color component
B. Entry the BLUE color component
P. Print the specific properties
Q. Quit without saving
S. Save and Exit
Select operation:>I

Entry an index [1...255]:>25
Current color value: [c3000019] = [byACI=25]

Select operation:>S
Stop modifying of the color properties

Current linetype = [16-"Continuous"-Linetype]
Select the Linetype object:
14-"ByBlock"
15-"ByLayer"
16-"Continuous"
Current: [16-"Continuous"]
Entry the name to be selected (or [?]-null/[:]-quit):>byLayer

Element 1: Offset=0, [byACI=25], [15-"ByLayer"-Linetype]

When the operation is L-"Print the list of elements":


------ Multi-Line Style Elements
0. Offset=0.5, Color=[byACI=34], [15-"ByLayer"-Linetype]
1. Offset=0, Color=[byACI=25], [15-"ByLayer"-Linetype]
2. Offset=-0.5, Color=[Foreground], [16-"Continuous"-Linetype]

When the operation is R-"Remove an existing element":


Entry the element index [0...2]:>1

------ Multi-Line Style Elements
0. Offset=0.5, Color=[byACI=34], [15-"ByLayer"-Linetype]
1. Offset=-0.5, Color=[Foreground], [16-"Continuous"-Linetype]

After entry, the operation P-"Print all properties" displays:


H=6A
  ------ Common Object Properties
  Type: AcDbMlineStyle
  Status: unerased,resident,modified,forRead,forWrite
  Database: c:\test.dwg
  ------ Specific Multi-Line Style Properties
  Key = <MLStyle>
  Name = "MLStyle"
  Elements = 2
  Fill color = [byRGB(32,16,8)]
  Fill status = On
  Miter status = On
  Start angle cap = 0.785398 radians
  Start square cap = On
  Start outer round cap = On
  Start inner round cap = Off
  End angle cap = 2.35619 radians
  End square cap = On
  End outer round cap = Off
  End inner round cap = On
  Description = "way with centre mall"
  ------ Multi-Line Style Elements
  0. Offset=0.5, Color=[byACI=34], [15-"ByLayer"-Linetype]
  1. Offset=-0.5, Color=[Foreground], [16-"Continuous"-Linetype]

Use the Q-"Quit" operation to exit:


Stop modifying of the multi-line style properties

See Also

Working with Multi-Line Styles

Example of Working with the Multi-Line Style Dictionary

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