Document & Objects
Inspect AutoCAD documents, colours, object ids and database objects, and retrieve objects from a drawing by id or handle.
AutoCAD Color
AutoCAD › Document · Introduced v1.2.25
Builds an AutoCAD colour from a variety of inputs, or breaks an existing AutoCAD colour down into its parts. You can supply an RGB colour, an AutoCAD Colour Index, or flag the colour as ByLayer or ByBlock, and the node returns a unified AutoCAD colour along with each of those representations. When several inputs are given the highest-priority one wins, in the order AutoCAD Colour, then ByLayer, then ByBlock, then ColorIndex, then RGB Colour; if nothing is supplied it defaults to ByLayer.
Inputs
An existing AutoCAD color to deconstruct. Highest priority.
ColorColouroptionalRGB color value. Lowest priority. If AutoCAD Color is set then this property will have not effect.
ColorIndexIntegeroptionalAutoCAD Color Index (1-255). Special values: 256=ByLayer, 0=ByBlock. If AutoCAD Color is set then this property will have not effect.
ByBlockBooleanoptionalIf true, use ByBlock color (inherits from containing block). If AutoCAD Color is set then this property will have not effect.
ByLayerBooleanoptionalIf true, use ByLayer color (inherits from layer). Default if no inputs. If AutoCAD Color is set then this property will have not effect.
Outputs
AutoCAD ColorAutoCAD ColourThe resulting AutoCAD color.
ColorColourRGB color value (resolved, may not reflect ByLayer/ByBlock).
ColorIndexIntegerAutoCAD Color Index. Special values: 256=ByLayer, 0=ByBlock.
ByBlockBooleanTrue if color is set to ByBlock.
ByLayerBooleanTrue if color is set to ByLayer.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | There is no open AutoCAD drawing to resolve the colour against. Open a drawing in AutoCAD before running the node. |
See also
AutoCAD DBObject
AutoCAD › Document · Introduced v1.0.16, updated v1.2.25
Reads the common properties of any AutoCAD database object. It always returns the object's identity (Id, handle, type name and extension dictionary), and when the object is a drawing entity it additionally reports its display properties such as layer, colour, material, linetype and lineweight. Use it to inspect or filter objects pulled from a drawing. The entity-specific outputs stay empty for objects that are not entities.
Inputs
DBObjectAutoCAD ObjectAn AutoCAD DBObject
Outputs
The ObjectId of the AutoCAD DBObject.
HandleIntegerThe Handle value of the AutoCAD DBObject.
TypeTextThe Type name of the AutoCAD DBObject.
ExtensionDictionaryIdAutoCAD ObjectIdThe ExtensionDictionary Id of the AutoCAD DBObject.
LayerNameTextThe layer name of the Entity. Null if not an Entity.
LayerIdAutoCAD ObjectIdThe layer ObjectId of the Entity. Null if not an Entity.
ColorAutoCAD ColourThe AutoCAD color of the Entity (supports ByLayer/ByBlock). Null if not an Entity.
MaterialNameTextThe material name of the Entity. Null if not an Entity.
MaterialIdAutoCAD ObjectIdThe material ObjectId of the Entity. Null if not an Entity.
LinetypeNameTextThe linetype name of the Entity. Null if not an Entity.
LinetypeIdAutoCAD ObjectIdThe linetype ObjectId of the Entity. Null if not an Entity.
LineWeightIntegerThe lineweight of the Entity in 1/100mm. -1=ByLayer, -2=ByBlock, -3=Default. Null if not an Entity.
See also
AutoCAD Object Id, AutoCAD Color, Get By Id, Get By Handle
AutoCAD Document
AutoCAD › Document · Introduced v1.0.0, updated v1.0.9
Reports details about an AutoCAD document, including its file name, file path, and whether it is read-only or the currently active drawing. If no document is supplied it uses the active document. Use it to identify which drawing your definition is working with.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
Outputs
File NameTextThe name of the AutoCAD file.
File PathTextThe file path of the AutoCAD file.
Read OnlyBooleanBoolean value indicating if the AutoCAD file is read only.
ActiveBooleanBoolean value indicating if the AutoCAD file is the active document at the time the solution is being solved.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open in AutoCAD. Open a drawing or connect a document to the input. |
See also
AutoCAD Object Id
AutoCAD › Document · Introduced v1.0.0, updated v1.0.13
Reports details about an AutoCAD ObjectId reference, including its numeric value, whether it is still valid, whether it has been erased, and the internal handle AutoCAD uses to store the object. Use it to verify that a referenced object still exists in the drawing.
Inputs
ObjectIdAutoCAD ObjectIdAn AutoCAD ObjectId
Outputs
ValueIntegerThe value of the AutoCAD ObjectId.
Is ValidBooleanBoolean value indicating if the AutoCAD ObjectId is valid
Is ErasedBooleanBoolean value indicating if the AutoCAD ObjectId is erased
Object HandleIntegerThe internal Handle which AutoCAD uses to store the object
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No document available | The drawing that owns this ObjectId could not be located and no drawing is open. Open the relevant drawing in AutoCAD. |
See also
AutoCAD DBObject, Get By Id, Named Id
Get AutoCAD Documents
AutoCAD › Document · Introduced v1.0.0
Returns every AutoCAD document that is currently open in the session, along with which one is the active drawing. Use it as a starting point when you want to choose or iterate over the open drawings.
Outputs
DocumentsAutoCAD DocumentAutoCAD Documents
Active DocumentAutoCAD DocumentThe currently active AutoCAD Document
See also
Get By Handle
AutoCAD › Document · Introduced v1.0.13
Looks up the AutoCAD object whose handle matches the value you provide and returns it. If no document is supplied it searches the active drawing. Use it to retrieve a specific object when you know its persistent handle.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
ObjectHandleIntegerAn AutoCAD ObjectHandle
Outputs
ObjectGenericAn Autocad Object
Menu & behaviour
- Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open in AutoCAD. Open a drawing or connect a document to the input. |
See also
Get By Id
AutoCAD › Document · Introduced v1.0.0, updated v1.0.13
Looks up the AutoCAD object whose ObjectId matches the one you provide and returns it. If no document is supplied it searches the active drawing. Use it to retrieve a specific object from an ObjectId reference.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
ObjectIdAutoCAD ObjectIdAn AutoCAD ObjectId
Outputs
ObjectGenericAn Autocad Object
Menu & behaviour
- Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open in AutoCAD. Open a drawing or connect a document to the input. |
See also
Get By Handle, AutoCAD Object Id, AutoCAD DBObject
Named Id
AutoCAD › Document · Introduced v1.2.19
Breaks a Named Id apart into its display name and the underlying AutoCAD ObjectId reference, and reports whether the Named Id is valid. Use it to read the human-readable label and the object reference that a Named Id carries together.
Inputs
Named IdNamed IdA Named Id combining a name with an ObjectId
Outputs
NameTextThe display name of the referenced object.
ObjectIdAutoCAD ObjectIdThe AutoCAD ObjectId reference.
Is ValidBooleanBoolean indicating if this NamedId is valid.