Blocks
Components for reading, creating and editing AutoCAD block references, block definitions, attributes and dynamic properties.
AutoCAD Block Reference
AutoCAD › Blocks · Introduced v1.0.0, updated v1.0.20
Gets or sets information on an existing AutoCAD block reference. Feed in a block reference to read back its name, location, rotation, scale, colour, layer, linetype, dynamic properties and attributes. If you also connect any of the optional inputs (origin, rotation, scale, layer, colour, linetype), the matching value is written back to the block in the drawing and the updated values are returned.
Inputs
BlockReferenceAutoCAD Block ReferenceAn AutoCAD Block Reference
OriginPointoptionalNew insertion point for the Block Reference (Rhino units)
RotationNumberoptionalNew rotation angle in radians
New scale for the Block Reference
New layer object ID
New color for the Block Reference
New linetype object ID
Outputs
NameTextThe name of the AutoCAD Block Reference.
The Id of the AutoCAD Block Reference.
OriginPointThe origin point of the Block Reference. Note this has been converted to the Rhino Units
RotationNumberThe Rotation of the Block Reference.
ScaleAutocad Scale3dThe Scale of the Block Reference. This will take either one uniform number or three numbers for a non uniform scale
BlockDefinitionIdAutoCAD ObjectIdThe Object Id of the AutoCAD Block Definition that this BlockReference is a reference of.
PropertiesDynamic Block PropertyThe Dynamic Block Reference Properties
AttributesBlock AttributesThe Block Reference Attributes
ColorAutoCAD ColourThe color of the Block Reference
LayerIdAutoCAD ObjectIdThe layer object ID
LinetypeIdAutoCAD ObjectIdThe linetype object ID
See also
Create AutoCAD Block Reference, Get AutoCAD Block References, AutoCAD Block Table Record, Dynamic Block Property, Block Attributes
AutoCAD Block Table Record
AutoCAD › Blocks · Introduced v1.0.0
Gets information from an AutoCAD block table record (a block definition). Connect a block table record to read its name, identifier, base origin point and the identifier of its extension dictionary. Use it when you need details about the underlying block definition rather than a placed instance.
Inputs
BlockTableRecordAutoCAD Block Table RecordAn AutoCAD Block Table Record
Outputs
NameTextThe name of the AutoCAD Block Table Record.
The Id of the AutoCAD Block Table Record.
OriginPointThe origin point of the Block Table Record. Note this has been converted to the Rhino Units
ExtensionDictionaryIdAutoCAD ObjectIdThe Id of the Extension Dictionary for this AutoCAD Block Table Record.
See also
Get AutoCAD Block Table Records, Get AutoCAD Block Table Record By Name, AutoCAD Block Reference, Extract Block Geometry
Autocad Scale3d
AutoCAD › Blocks · Introduced v1.0.16
Creates an AutoCAD scale made of three factors for use when placing or editing block references. If you connect only one of the three factors, that value is used to build a uniform scale; if you connect more than one, the X, Y and Z factors are combined into a non-uniform scale. Each factor defaults to 1 when left unconnected.
Inputs
XNumberoptionalThe X Scale Factor, if non of the other factors are connected this will be used create a uniform scale
YNumberoptionalThe Y Scale Factor, if non of the other factors are connected this will be used create a uniform scale
ZNumberoptionalThe Z Scale Factor, if non of the other factors are connected this will be used create a uniform scale
Outputs
Scale3dAutocad Scale3dAn AutoCAD 3d scale
See also
Create AutoCAD Block Reference, AutoCAD Block Reference
Block Attributes
AutoCAD › Blocks · Introduced v1.0.16
Gets information from an AutoCAD block attribute reference. Connect a block attribute to read its tag, current value, whether it is a multiline (MText) attribute, and its location in the drawing (converted to Rhino units). Use it to inspect the text fields carried by a placed block.
Inputs
AttributeBlock AttributesA Dynamic Block Attribute Reference
Outputs
TagTextThe tag of the attribute
ValueTextThe value of the attribute
Is MultilineBooleanWhether the property is a Multiline (MText)
LocationPointThe location of attribute reference, converted to Rhino's Units.
See also
Set Block Attributes, AutoCAD Block Reference
Create AutoCAD Block Reference
AutoCAD › Blocks · Introduced v1.0.0, updated v1.0.21
Creates one or more AutoCAD block references from a block definition at the insertion point(s) you supply, optionally setting rotation, scale, layer, colour and linetype. You can place several copies at once by feeding a list of insertion points. The block references are created in memory; to add them to the AutoCAD document use the AutoCAD Bake component.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
BlockDefinitionAutoCAD Block Table RecordThe Block Definition to insert
InsertionPointsPointThe insertion point(s) for the Block Reference(s), as Rhino Points
RotationNumberoptionalThe rotation angle in radians
The Scale of the Block Reference. This will take either one uniform number or three numbers for a non uniform scale
The layer object ID for the Block Reference
The color for the Block Reference
The linetype object ID for the Block Reference
Outputs
BlockReferencesAutoCAD Block ReferenceThe created AutoCAD Block Reference(s)
Menu & behaviour
- Right-click Replace Previous Object (on by default) — deletes the objects this node previously created before making new ones, so editing inputs updates the drawing in place instead of leaving duplicates behind.
- Right-click Save Connection Between Sessions (on by default) — remembers the link to created objects when the Grasshopper file is saved and reopened.
- Right-click Clear Connection — forgets the tracked objects without deleting them from the drawing.
- Skips re-creating objects when inputs are unchanged (shows the remark "No change in inputs, reusing last created"), and defers one solve after a Rhino undo/redo to avoid a Civil 3D crash.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and AutoCAD has no active drawing. Open a drawing or connect a Document input. |
See also
AutoCAD Block Reference, Get AutoCAD Block References, AutoCAD Block Table Record, Autocad Scale3d
Dynamic Block Property
AutoCAD › Blocks · Introduced v1.0.0, updated v1.0.11
Gets information from an AutoCAD dynamic block reference property. Connect a dynamic property to read its name, current value, whether it is read-only, the type of values it accepts, and the list of allowed values if the property is restricted to a fixed set. Use it to inspect the adjustable parameters of a dynamic block.
Inputs
PropertyDynamic Block PropertyA Dynamic Block Reference Property
Outputs
NameTextThe name of the property
ValueGenericThe value of the property
IsReadOnlyBooleanWhether the property is read-only
TypeGenericThe type of values allowed.
AllowedValuesGenericThe values allowed, if the Property is restricted.
See also
Set Dynamic Block Properties, AutoCAD Block Reference
Extract Block Geometry
AutoCAD › Blocks · Introduced v1.0.0
Extracts the geometry contained inside an AutoCAD block. It accepts either a block table record (a block definition) or a block reference (a placed instance) and returns the individual objects that make up the block as Rhino geometry. Use it to access or process the contents of a block.
Inputs
BlockGenericThe AutoCAD Block Table Record or Block Reference to extract geometry from
Outputs
BlockObjectsGeometryThe objects in the block
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | Input must be a Block Reference or Block Table Record | The Block input is something other than a block reference or block definition. Connect a valid block. |
| Error | No document available | The block could not be matched to an open AutoCAD document. Make sure the source drawing is open. |
See also
AutoCAD Block Reference, AutoCAD Block Table Record
Get AutoCAD Block References
AutoCAD › Blocks · Introduced v1.0.0, updated v1.0.9
Returns all the AutoCAD block references in a document that are instances of a given block table record (block definition). Standard references and anonymous (dynamic) references are returned on separate outputs. Use the DirectOnly toggle to choose whether nested instances are included or only top-level placements are returned.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
BlockTableRecordIdAutoCAD ObjectIdThe Block Table Record to get the References of
DirectOnlyBooleanIf true the search will only look at for Block Reference which are not nested, if false then all nested blocks will be included.
Outputs
BlockReferencesAutoCAD Block ReferenceThe AutoCAD BlockReferences
AnonymousBlockReferencesAutoCAD Block ReferenceThe AutoCAD Anonymous BlockReferences
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 AutoCAD has no active drawing. Open a drawing or connect a Document input. |
| Warning | No Block Table Found with that Id | The supplied identifier does not match a block table record in the document. Check the RecordId input. |
See also
AutoCAD Block Reference, Get AutoCAD Block Table Records, AutoCAD Block Table Record
Get AutoCAD Block Table Record By Name
AutoCAD › Blocks · Introduced v1.2.24
Returns the AutoCAD block table record (block definition) whose name matches the text you supply. Use it to fetch a specific block definition by name so you can place it or read its details, rather than working through the full list of records.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
NameTextThe name of the AutoCAD Block Table Record to retrieve
Outputs
BlockTableRecordAutoCAD Block Table RecordThe AutoCAD Block Table Record matching the name
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 AutoCAD has no active drawing. Open a drawing or connect a Document input. |
| Warning | No Block Table Record exists with name: {name} | No block definition in the document has the supplied name. Check the spelling against the names returned by Get AutoCAD Block Table Records. |
See also
Get AutoCAD Block Table Records, AutoCAD Block Table Record, Create AutoCAD Block Reference
Get AutoCAD Block Table Records
AutoCAD › Blocks · Introduced v1.0.0, updated v1.0.9
Returns the list of all AutoCAD block table records (block definitions) in a document. Use it to browse every block defined in the drawing, then filter or feed the results into other block components.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
Outputs
BlockTableRecordsAutoCAD Block Table RecordThe AutoCAD BlockTableRecords
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 AutoCAD has no active drawing. Open a drawing or connect a Document input. |
See also
Get AutoCAD Block Table Record By Name, AutoCAD Block Table Record, Get AutoCAD Block References
Set Block Attributes
AutoCAD › Blocks · Introduced v1.0.16
Sets the properties of an AutoCAD block attribute reference. Connect an attribute and supply a new value and/or whether it should be a multiline (MText) attribute; the attribute is updated in the drawing and the revised attribute is returned along with its tag, value, multiline flag and location. Leave an input unconnected to keep the attribute's existing setting.
Inputs
AttributeBlock AttributesA Dynamic Block Attribute Reference
ValueTextoptionalThe Text of the property
Is MultilineBooleanoptionalA boolean indicating if the property should use the Multiline (MText)
Outputs
AttributeBlock AttributesA Dynamic Block Attribute Reference
TagTextThe tag of the attribute
ValueTextThe value of the attribute
Is MultilineBooleanWhether the property is a Multiline (MText)
LocationPointThe location of attribute reference, converted to Rhino's Units.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | The attribute could not be matched to an open AutoCAD document. Make sure the source drawing is open. |
See also
Block Attributes, AutoCAD Block Reference
Set Dynamic Block Properties
AutoCAD › Blocks · Introduced v1.0.0, updated v1.0.11
Sets the value of an AutoCAD dynamic block reference property. Connect a dynamic property and a new value to drive a dynamic block parameter (such as a visibility state, distance or angle) and update the block in the drawing. The revised property and its value are returned. Leave the value input unconnected to keep the property unchanged.
Inputs
PropertyDynamic Block PropertyA Dynamic Block Reference Property
ValueGenericoptionalThe value of the property
Outputs
PropertyDynamic Block PropertyA Dynamic Block Reference Property
ValueGenericThe value of the property
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No document available | The property could not be matched to an open AutoCAD document. Make sure the source drawing is open. |