Layouts
Nodes for reading, creating, and editing AutoCAD layouts.
Changed in v1.3.0. The Get … components no longer recompute automatically by default. A drawing change now marks their data stale and shows a Refresh button. Definitions saved before v1.3.0 open with Auto Update switched off — if a definition relied on a Get component keeping itself in step with the drawing, turn Auto Update back on for it and re-save. See Stale data and Refresh.
AutoCAD Layout
AutoCAD › Layouts · Introduced v1.0.0, updated v1.0.5
Reads the details of an existing AutoCAD layout and breaks them out into separate values. Feed it a layout and you get back its name, identifier, tab display order and the block table record it is associated with.
Inputs
LayoutAutoCAD LayoutAn AutoCAD Layout
Outputs
NameTextThe name of the AutoCAD Layout
The Id of the AutoCAD Layout
TabOrderIntegerThe tab display order
BlockTableRecordIdAutoCAD ObjectIdThe associated block table record ID
See also
Set AutoCAD Layout, Get AutoCAD Layouts, Get AutoCAD Layout By Name, Create AutoCAD Layout
Create AutoCAD Layout
AutoCAD › Layouts · Introduced v1.0.0, updated v1.0.20
Creates a new layout in an AutoCAD document. Give it a name and, optionally, a target document; if no document is supplied the active drawing is used. The new layout's details are returned. If a layout with the same name already exists it is returned instead of creating a duplicate.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
NameTextThe name of the new AutoCAD Layout
Outputs
NameTextThe name of the AutoCAD Layout
The Id of the AutoCAD Layout
TabOrderIntegerThe tab display order
BlockTableRecordIdAutoCAD ObjectIdThe associated block table record ID
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. Open a drawing or connect a document. |
| Error | Layout name cannot be empty | The name was blank or whitespace. Supply a valid layout name. |
| Warning | A Layout with this name already exists | A layout of that name is already in the drawing; the existing layout is returned. Choose a different name to create a new one. |
See also
AutoCAD Layout, Get AutoCAD Layout By Name, Get AutoCAD Layouts, Set AutoCAD Layout
Get AutoCAD Layout By Name
AutoCAD › Layouts · Introduced v1.0.0, updated v1.3.0
Finds a single layout in an AutoCAD drawing by its exact name. Optionally target a specific document; if none is supplied the active drawing is searched. Use this when you already know the layout name and want to pull just that one layout.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
NameTextThe name of the AutoCAD Layout to retrieve
Outputs
LayoutAutoCAD LayoutThe AutoCAD Layout matching the name, or the default layout if no matching layout is found
Menu & behaviour
- Changes in the AutoCAD document mark this node's data stale rather than recomputing it. The capsule renders pale blue, its message reads "Stale Data", and a Refresh button is drawn just below the component — press it to clear the stale state and re-solve.
- A remark reports what changed, in the form "Data is stale: 2 added, 1 deleted, 4 modified. Press Refresh to update." Counts accumulate across successive AutoCAD commands until you refresh.
- Right-click Auto Update (off by default) — when enabled, the node recomputes by itself whenever relevant objects are added, modified, or erased in the AutoCAD document, and never shows the stale state. Switching it on while the node is stale refreshes it immediately. The setting is remembered when the Grasshopper file is saved and reopened.
- Any re-solve clears the stale state, not only the Refresh button — an upstream input change or a manual recompute resets it too. Staleness applies to changes made in the drawing, not to changes on the canvas.
- Auto Update was always on, and not switchable, before v1.3.0. Definitions saved with an earlier version open with it off — see Stale data and Refresh.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open. Open a drawing or connect a document. |
| Warning | No layout exists with name: {name} | No layout matches the supplied name. Check the spelling, or use Get AutoCAD Layouts to list available layouts. |
See also
AutoCAD Layout, Get AutoCAD Layouts, Create AutoCAD Layout, Set AutoCAD Layout
Get AutoCAD Layouts
AutoCAD › Layouts · Introduced v1.0.0, updated v1.3.0
Returns every layout in an AutoCAD drawing as a list. Optionally target a specific document; if none is supplied the active drawing is used. Use this to browse all layouts or to feed downstream nodes that filter or process them.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
Outputs
LayoutsAutoCAD LayoutThe AutoCAD Layouts
Menu & behaviour
- Changes in the AutoCAD document mark this node's data stale rather than recomputing it. The capsule renders pale blue, its message reads "Stale Data", and a Refresh button is drawn just below the component — press it to clear the stale state and re-solve.
- A remark reports what changed, in the form "Data is stale: 2 added, 1 deleted, 4 modified. Press Refresh to update." Counts accumulate across successive AutoCAD commands until you refresh.
- Right-click Auto Update (off by default) — when enabled, the node recomputes by itself whenever relevant objects are added, modified, or erased in the AutoCAD document, and never shows the stale state. Switching it on while the node is stale refreshes it immediately. The setting is remembered when the Grasshopper file is saved and reopened.
- Any re-solve clears the stale state, not only the Refresh button — an upstream input change or a manual recompute resets it too. Staleness applies to changes made in the drawing, not to changes on the canvas.
- Auto Update was always on, and not switchable, before v1.3.0. Definitions saved with an earlier version open with it off — see Stale data and Refresh.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open. Open a drawing or connect a document. |
See also
AutoCAD Layout, Get AutoCAD Layout By Name, Create AutoCAD Layout, Set AutoCAD Layout
Set AutoCAD Layout
AutoCAD › Layouts · Introduced v1.0.0, updated v1.0.5
Edits the properties of an existing AutoCAD layout. Connect a layout and supply a new name; if you leave the name unconnected the current name is kept. The layout is only renamed when the name actually changes, and the updated details are returned.
Inputs
LayoutAutoCAD LayoutAn AutoCAD Layout
NewNameTextoptionalNew layout name
Outputs
NameTextThe name of the AutoCAD Layout
The Id of the AutoCAD Layout
TabOrderIntegerThe tab display order
BlockTableRecordIdAutoCAD ObjectIdThe associated block table record ID
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | Layout name cannot be empty | The supplied name was blank or whitespace. Provide a valid layout name. |
| Error | {message} | The rename failed in AutoCAD; the underlying error text is shown. Check the name is valid and unique, then retry. |
See also
AutoCAD Layout, Create AutoCAD Layout, Get AutoCAD Layout By Name, Get AutoCAD Layouts