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 > Layers Table > Layer Status
Status of Layers

The layer record object has a set of flags that define its visibility, and availability for selection, editing, printing, use, and regeneration. In the examples below, the pLayer variable stores a pointer to the layer record object.

Freeze Status

The freeze status determines whether the layer is invisible and accessible for regenerating, printing, selecting, and editing. Entities associated with a frozen layer cannot be selected, made visible, edited, regenerated, or printed. A frozen layer cannot be the active layer. A frozen layer is hidden for rendering. The layer defines the freeze status as a Boolean value which is True when the layer is frozen or False when the layer is thawed. The freeze status is a False (Thawed) by default.

To get the freeze status, use the isFrozen() method of the layer record object; it does not have arguments and returns True when the status is set to "frozen" or False when the status is set to "thawed". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isFrozen()) ? L"frozen" : L"thawed"));

To set the freeze status, use the setIsFrozen() method of the layer record object which requires one argument — the freeze status as a Boolean value — and does not return a value. For example:


// Freeze a layer
pLayer->setIsFrozen(true);

// Thaw a layer
pLayer->setIsFrozen(false);

Lock Status

The lock status determines whether the layer is accessible for selecting and editing. Entities associated with a locked layer cannot be selected or edited, but they are visible and printable. New entities can be added to a locked layer, but cannot be edited at the same time. A locked layer can be the active layer. A locked layer is shown for rendering. The layer defines the lock status as a Boolean value which is True when the layer is locked (non-editable) or False when the layer is unlocked (editable). The lock status is False (Unlocked) by default.

To get the lock status, use the isLocked() method of the layer record object; it does not have arguments and returns True when the status is set to "locked" or False when the status is set to "unlocked". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isLocked()) ? L"locked" : L"unlocked"));

To set the lock status, use the setIsLocked() method of the layer record object which requires one argument — the lock status as a Boolean value — and does not return a value. For example:


// Lock a layer
pLayer->setIsLocked(true);

// Unlock a layer
pLayer->setIsLocked(false);

On-Off Status

The on-off status determines whether the layer is invisible and accessible for printing. Entities associated with a layer that is turned off cannot be made visible or printed, but they can be edited and selected. New entities can be added to a layer that is turned off, but cannot be drawn at the same time. A layer that is turned off can be the active layer. The on-off status does not affect whether entities are regenerated. The layer defines the on-off status as a Boolean value which is True when the layer is off (invisible) or False when the layer is on (visible). The on-off status is False (Visible) by default.

To get the on-off status, use the isOff() method of the layer record object; it does not have arguments and returns True when the status is set to "off" or False when the status is set to "on". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isOff()) ? L"off" : L"on"));

To set the on-off status, use the setIsOff() method of the layer record object which requires one argument — the on-off status as a Boolean value — and does not return a value. For example:


// Turn off a layer
pLayer->setIsOff(true);

// Turn on a layer
pLayer->setIsOff(false);

Plot Status

The plot status determines whether the layer is accessible for printing. Entities associated with a plottable layer are printable. A non-plottable layer can be active. The layer defines the plot status as a Boolean value which is True when the layer is plottable, or False when the layer is non-plottable. The plot status is True (Plottable) by default.

To get the plot status, use the isPlottable() method of the layer record object that does not have arguments and returns True when the status is set to "plottable", or False when the status is set to "unplottable". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isPlottable()) ? L"plottable" : L"unplottable"));

To set the plot status, use the setIsPlottable() method of the layer record object that requires a one argument — the plot status as a Boolean value — and does not return a value. For example:


// Plot a layer
pLayer->setIsPlottable(true);

// Unplot a layer
pLayer->setIsPlottable(false);

Hidden Status

The hidden status determines whether the layer is displayed for the host application. The layer defines the hidden status as a Boolean value which is True when the layer is hidden, or False when the layer is shown. The hidden status is False (Shown) by default.

To get the hidden status, use the isHidden() method of the layer record object that does not have arguments and returns True when the status is set to "hidden", or False when the status is set to "shown". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isHidden()) ? L"hidden" : L"shown"));

To set the hidden status, use the setIsHidden() method of the layer record object that requires a one argument — the hidden status as a Boolean value — and does not return a value. For example:


// Hide a layer
pLayer->setIsHidden(true);

// Show a layer
pLayer->setIsHidden(false);

Reconcile Status

The reconcile status determines whether the layer is reconciled with another object. The layer defines the reconcile status as a Boolean value which is True when the layer is reconciled, or False when the layer is not reconciled.

To get the reconcile status, use the isReconciled() method of the layer record object that does not have arguments and returns True when the status is set to "reconciled", or False when the status is set to "non-reconciled". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isReconciled()) ? L"reconciled" : L"non-reconciled"));

To set the reconcile status, use the setIsReconciled() method of the layer record object that requires a one argument — the reconcile status as a Boolean value — and does not return a value. For example:


// Layer is reconciled
pLayer->setIsReconciled(true);

// Layer is non-reconciled
pLayer->setIsReconciled(false);

In-Use Status

The in-use status determines whether the layer is in-use when the generateUsageData() method is called. The layer defines the in-use status as a Boolean value which is True when the layer is in-use, or False when the layer is not use. The in-use status is read-only and layer record object can not change it. Usage data is not available if the layer record object is not part of the database or if the generateUsageData() method has not been called since this layer was constructed. The lock status is True (InUse) by default.

To get the in-use status, use the isInUse() method of the layer record object that does not have arguments and returns True when the status is set to "in-used", or False when the status is set to "unused". For example:


odPrintConsoleString(L"\nLayer is %ls\n", ((pLayer->isInUse()) ? L"in-use" : L"unused"));

See Also

Working with Layers

Specific Properties of Layers

Example of Working with the Layer Record Object

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