Line Types
Components for reading, creating and editing AutoCAD line type patterns.
The Get … components do not recompute on their own by default. A drawing change marks their data stale and shows a Refresh button; right-click Auto Update to switch a component back to recomputing automatically. See Stale data and Refresh.
AutoCAD Line Type
AutoCAD › LineTypes · Introduced v1.0.0, updated v1.3.2
Reads the details of an existing AutoCAD line type pattern and breaks them out into separate values. Feed it a line pattern and you get back its name, identifier, pattern geometry and comments for inspection or onward use.
Inputs
LinePatternAutoCAD LineTypeAn AutoCAD Line Pattern
Outputs
NameTextThe name of the AutoCAD Line Pattern.
The Id of the AutoCAD Line Pattern.
PatternLengthNumberTotal length of the linetype pattern
NumberOfDashesIntegerNumber of dash segments in the pattern
ScaleToFitBooleanWhether the pattern is scaled to fit geometry
CommentsTextComments associated with the linetype
See also
Set AutoCAD Line Type, Get AutoCAD Line Types, Get AutoCAD Line Type By Name, Create AutoCAD Line Type
Create AutoCAD Line Type
AutoCAD › LineTypes · Introduced v1.0.0, updated v1.3.2
Creates a new line type in an AutoCAD document. Give it a name and, optionally, a pattern length, number of dashes and whether the pattern scales to fit geometry; if no document is supplied the active drawing is used. The line type itself is returned along with its details, so it can be passed straight on without being looked up again. If a line type 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 AutoCAD LineType
PatternLengthNumberTotal length of the linetype pattern
NumberOfDashesIntegerNumber of dash segments in the pattern
ScaleToFitBooleanWhether to scale pattern to fit geometry
Outputs
LineTypeAutoCAD LineTypeThe created AutoCAD LineType
NameTextThe name of the AutoCAD LineType
The Id of the AutoCAD LineType
PatternLengthNumberTotal length of the linetype pattern
NumberOfDashesIntegerNumber of dash segments in the pattern
ScaleToFitBooleanWhether the pattern is scaled to fit geometry
CommentsTextComments associated with the linetype
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 | PatternLength must be positive or zero | A negative pattern length was supplied. Use zero or a positive value. |
| Error | NumberOfDashes must be non-negative | A negative dash count was supplied. Use zero or a positive whole number. |
| Warning | LineType already exists | A line type of that name is already in the drawing; the existing line type is returned. Choose a different name to create a new one. |
See also
AutoCAD Line Type, Get AutoCAD Line Type By Name, Get AutoCAD Line Types, Set AutoCAD Line Type
Get AutoCAD Line Type By Name
AutoCAD › LineTypes · Introduced v1.0.0, updated v1.3.0
Finds a single line type 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 line type name and want to pull just that one.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
NameTextThe name of the AutoCAD LineType to retrieve
Outputs
LineTypeAutoCAD LineTypeThe AutoCAD LineType matching the name, or the default linetype if no matching linetype 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. See Stale data and Refresh.
- 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.
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 line type matches the supplied name. Check the spelling, or use Get AutoCAD Line Types to list available line types. |
See also
AutoCAD Line Type, Get AutoCAD Line Types, Create AutoCAD Line Type, Set AutoCAD Line Type
Get AutoCAD Line Types
AutoCAD › LineTypes · Introduced v1.0.0, updated v1.3.0
Returns every line type 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 line types or to feed downstream nodes that filter or process them.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
Outputs
LineTypesAutoCAD LineTypeThe AutoCAD LineTypes
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. See Stale data and Refresh.
- 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.
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 Line Type, Get AutoCAD Line Type By Name, Create AutoCAD Line Type, Set AutoCAD Line Type
Set AutoCAD Line Type
AutoCAD › LineTypes · Introduced v1.0.0, updated v1.3.2
Edits the properties of an existing AutoCAD line type. Connect a line type and supply any of the new name, pattern length, dash count, scale-to-fit setting or comments; values you leave unconnected keep their current settings. The line type is only rewritten when one of those properties actually changes, and the line type itself is returned along with its updated details.
Inputs
LineTypeAutoCAD LineTypeAn AutoCAD LineType
NewNameTextoptionalThe name of the AutoCAD Layer.
NewPatternLengthNumberoptionalNew pattern length
NewNumberOfDashesIntegeroptionalNew number of dashes
NewScaleToFitBooleanoptionalNew scale to fit setting
NewCommentsTextoptionalNew comments for the linetype
Outputs
LineTypeAutoCAD LineTypeThe updated AutoCAD LineType
NameTextThe name of the AutoCAD LineType
The Id of the AutoCAD LineType
PatternLengthNumberTotal length of the linetype pattern
NumberOfDashesIntegerNumber of dash segments in the pattern
ScaleToFitBooleanWhether the pattern is scaled to fit geometry
CommentsTextComments associated with the linetype
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | Line Type name cannot be empty | The supplied name was blank or whitespace. Provide a valid line type name. |
| Error | PatternLength must be positive or zero | A negative pattern length was supplied. Use zero or a positive value. |
| Error | NumberOfDashes must be non-negative | A negative dash count was supplied. Use zero or a positive whole number. |
| Error | No document available | The drawing that owns this line type could not be located. Make sure the source drawing is open. |
See also
AutoCAD Line Type, Create AutoCAD Line Type, Get AutoCAD Line Type By Name, Get AutoCAD Line Types