Blocks

Components for reading, creating and editing AutoCAD block references, block definitions, attributes and dynamic properties.


AC-BlkRefBlocks

AutoCAD Block Reference

AutoCAD Block Reference icon

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

An AutoCAD Block Reference

OriginPointoptional

New insertion point for the Block Reference (Rhino units)

RotationNumberoptional

New rotation angle in radians

ScaleAutocad Scale3doptional

New scale for the Block Reference

LayerIdAutoCAD ObjectIdoptional

New layer object ID

ColorAutoCAD Colouroptional

New color for the Block Reference

LinetypeIdAutoCAD ObjectIdoptional

New linetype object ID

Outputs

NameText

The name of the AutoCAD Block Reference.

The Id of the AutoCAD Block Reference.

OriginPoint

The origin point of the Block Reference. Note this has been converted to the Rhino Units

RotationNumber

The Rotation of the Block Reference.

The Scale of the Block Reference. This will take either one uniform number or three numbers for a non uniform scale

BlockDefinitionIdAutoCAD ObjectId

The Object Id of the AutoCAD Block Definition that this BlockReference is a reference of.

The Dynamic Block Reference Properties

The Block Reference Attributes

The color of the Block Reference

The layer object ID

The linetype object ID

See also

Create AutoCAD Block Reference, Get AutoCAD Block References, AutoCAD Block Table Record, Dynamic Block Property, Block Attributes



AC-BlkRecBlocks

AutoCAD Block Table Record

AutoCAD Block Table Record icon

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

An AutoCAD Block Table Record

Outputs

NameText

The name of the AutoCAD Block Table Record.

The Id of the AutoCAD Block Table Record.

OriginPoint

The origin point of the Block Table Record. Note this has been converted to the Rhino Units

ExtensionDictionaryIdAutoCAD ObjectId

The 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



AC-ScaleBlocks

Autocad Scale3d

Autocad Scale3d icon

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

XNumberoptional

The X Scale Factor, if non of the other factors are connected this will be used create a uniform scale

YNumberoptional

The Y Scale Factor, if non of the other factors are connected this will be used create a uniform scale

ZNumberoptional

The Z Scale Factor, if non of the other factors are connected this will be used create a uniform scale

Outputs

An AutoCAD 3d scale

See also

Create AutoCAD Block Reference, AutoCAD Block Reference



AC-AttrBlocks

Block Attributes

Block Attributes icon

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

A Dynamic Block Attribute Reference

Outputs

TagText

The tag of the attribute

ValueText

The value of the attribute

Is MultilineBoolean

Whether the property is a Multiline (MText)

LocationPoint

The location of attribute reference, converted to Rhino's Units.

See also

Set Block Attributes, AutoCAD Block Reference



AC-BlkRefBlocks

Create AutoCAD Block Reference

Create AutoCAD Block Reference icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

The Block Definition to insert

InsertionPointsPoint

The insertion point(s) for the Block Reference(s), as Rhino Points

RotationNumberoptional

The rotation angle in radians

ScaleAutocad Scale3doptional

The Scale of the Block Reference. This will take either one uniform number or three numbers for a non uniform scale

LayerIdAutoCAD ObjectIdoptional

The layer object ID for the Block Reference

ColorAutoCAD Colouroptional

The color for the Block Reference

LinetypeIdAutoCAD ObjectIdoptional

The linetype object ID for the Block Reference

Outputs

The 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

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo 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



AC-DynPrpBlocks

Dynamic Block Property

Dynamic Block Property icon

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

A Dynamic Block Reference Property

Outputs

NameText

The name of the property

ValueGeneric

The value of the property

IsReadOnlyBoolean

Whether the property is read-only

TypeGeneric

The type of values allowed.

AllowedValuesGeneric

The values allowed, if the Property is restricted.

See also

Set Dynamic Block Properties, AutoCAD Block Reference



AC-ExtBlkBlocks

Extract Block Geometry

Extract Block Geometry icon

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

BlockGeneric

The AutoCAD Block Table Record or Block Reference to extract geometry from

Outputs

BlockObjectsGeometry

The objects in the block

Exceptions

LevelMessageCause & fix
ErrorInput must be a Block Reference or Block Table RecordThe Block input is something other than a block reference or block definition. Connect a valid block.
ErrorNo document availableThe 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



AC-BlkRefsBlocks

Get AutoCAD Block References

Get AutoCAD Block References icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

BlockTableRecordIdAutoCAD ObjectId

The Block Table Record to get the References of

DirectOnlyBoolean

If true the search will only look at for Block Reference which are not nested, if false then all nested blocks will be included.

Outputs

The AutoCAD BlockReferences

AnonymousBlockReferencesAutoCAD Block Reference

The AutoCAD Anonymous BlockReferences

Menu & behaviour

  • Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.

Exceptions

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo document was supplied and AutoCAD has no active drawing. Open a drawing or connect a Document input.
WarningNo Block Table Found with that IdThe 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



AC-BlockByNameBlocks

Get AutoCAD Block Table Record By Name

Get AutoCAD Block Table Record By Name icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

NameText

The name of the AutoCAD Block Table Record to retrieve

Outputs

The 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

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo document was supplied and AutoCAD has no active drawing. Open a drawing or connect a Document input.
WarningNo 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



AC-BlkRecsBlocks

Get AutoCAD Block Table Records

Get AutoCAD Block Table Records icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

Outputs

The AutoCAD BlockTableRecords

Menu & behaviour

  • Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.

Exceptions

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo 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



AC-SetAttrBlocks

Set Block Attributes

Set Block Attributes icon

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

A Dynamic Block Attribute Reference

ValueTextoptional

The Text of the property

Is MultilineBooleanoptional

A boolean indicating if the property should use the Multiline (MText)

Outputs

A Dynamic Block Attribute Reference

TagText

The tag of the attribute

ValueText

The value of the attribute

Is MultilineBoolean

Whether the property is a Multiline (MText)

LocationPoint

The location of attribute reference, converted to Rhino's Units.

Exceptions

LevelMessageCause & fix
ErrorNo active AutoCAD document availableThe attribute could not be matched to an open AutoCAD document. Make sure the source drawing is open.

See also

Block Attributes, AutoCAD Block Reference



AC-SetPrpBlocks

Set Dynamic Block Properties

Set Dynamic Block Properties icon

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

A Dynamic Block Reference Property

ValueGenericoptional

The value of the property

Outputs

A Dynamic Block Reference Property

ValueGeneric

The value of the property

Exceptions

LevelMessageCause & fix
ErrorNo document availableThe property could not be matched to an open AutoCAD document. Make sure the source drawing is open.

See also

Dynamic Block Property, AutoCAD Block Reference