caDanPlugins – User Guide
Custom commands for AutoCAD 2025 (caDanPlugins) and Civil 3D 2025 (c3DanPlugins). Type the command name on the command line to run it.
Commands
AutoCAD (caDanPlugins) – also available in Civil 3D
| Command | Description |
|---|---|
POLY3DPIPE | Create a swept pipe solid along a polyline |
POLYLINEFROMPIPESOLID | Extract the centerline polyline from a 3D pipe solid |
POLY3DTOOLS | Convert 3D polylines to 2D, or move them in Z |
SIMPLIFY3DPOLY | Simplify 3D polylines using a distance-based tolerance |
POLYSEG | Insert segment marker blocks with attributes at the midpoint of each segment |
POLYCALC | Calculate area or length of polylines and insert a block with the result |
GEOMPROPS | Dockable palette showing the total length, area and volume of the current selection |
BLOCK2POINT | Convert selected block references to 3D points, per layer |
ELEVATIONBLOCK | Insert an elevation block at a picked 3D point |
ELEVATIONBLOCKSLOPE | Insert or update an elevation block from a source block and a slope |
ELEVATIONBLOCKINTERPOLATE | Insert or update an elevation block interpolated between two source blocks |
EXPORTBLOCKS | Export selected block references and their attributes to CSV |
COPYALIGNROTATE | Copy and align objects, or set the rotation of blocks |
EDITTEXT | Edit or copy text content from different text objects |
LAYERDESCRIPTION | Set layer descriptions from BIM code Excel files |
CHANGELINETYPECOLORBYOBJECT | Change the linetype or color of an object's layer by picking the object |
UPDATETITLEBLOCK | Update title block attributes and DWG properties from an Excel file |
EXPORTXREFS | Save the xref configuration to an .xr file |
IMPORTXREFS | Restore the xref configuration from an .xr file |
MULTISCRIPT | Run a script on multiple drawings |
CHECKLICENSE | Show license status, user and domain |
(ReturnDWGproperty) | AutoLISP function (not a command) that returns DWG properties |
Civil 3D (c3DanPlugins)
| Command | Description |
|---|---|
EXCELPROPERTYSET | Read Property Set values from Excel and write them to objects in the drawing |
PROPERTYSETEXPORT | Export all Property Sets in model space to CSV (one file per Property Set Definition) |
PSETSELECT | Dockable palette that selects model space objects by Property Set values |
CORRIDORSWAPASSEMBLY | Dockable palette that swaps the assembly of a corridor region and maps every old target onto a target of the new assembly (saved/loaded as XML) |
CORRIDORBULKTARGETS | Opens the Set targets tab of the same palette: sets one surface/alignment/layer on every matching target of the chosen regions |
SUPERELEVATIONPLAN | Dockable palette that sets the superelevation of an alignment: pick sections in plan and type the cross slope of each lane in a table |
CODESETSTYLEEXPORT | Export Code Set Styles to CSV (one file per code type: POINT, LINK, SHAPE) |
CODESETSTYLEIMPORT | Import a Code Set Style from Excel (sheets POINT, LINK, SHAPE); missing styles are created |
EXPORTGEOJSON | Export selected closed LWPOLYLINEs to a project GeoJSON file in WGS84, from the drawing's coordinate system (SWEREF 99 TM, SWEREF 99 local zones, LKS94, LKS-92, L-EST97, ETRS89 UTM 34N/35N) |
Installation
The plugins are installed with an MSI installer, which puts the
caDanPlugins.bundle folder in
%ProgramData%\Autodesk\ApplicationPlugins\. AutoCAD and
Civil 3D then load the plugins automatically at the next start – no
NETLOAD needed.
License and updates
- At startup the plugin checks the license against the license server (at most once per day). If the server can't be reached, the plugin keeps working for up to 10 days.
- If the license check fails, all commands are disabled. Run
CHECKLICENSEto see why. - When a newer version of caDanPlugins is released, a dialog is shown once, and a line is written to the command line at every startup until you update.
Command details
UPDATETITLEBLOCK
Updates title block attributes and the DWG properties Title, Subject,
Keywords and Comments from the columns dwgTitle,
dwgSubject, dwgKeyword and dwgComment on the first
matching row of the Titleblocks sheet. Each cell value is treated as a template:
- Text without
[...]is a static value and is written as is. [COLUMNNAME]is replaced with the value of another column on the same row (case-insensitive).[REVTAGS:COLUMNNAME]is replaced with the value ofCOLUMNNAMEon the drawing's/layout's latest row in theRevtagssheet (the row that would be inserted last as a revision tag – see therevtag_revtagcolumn in theSettingssheet for the sort order). Requires revision tags to be configured (SettingsandRevtagssheets); otherwise the result is empty and a warning is shown.- Static text and
[...]references can be combined freely in the same cell. - Two
[...]references directly next to each other get a space inserted between the values. - A missing column/token or an empty value gives an empty string at that position and a warning.
Exception: if the drawing has no revision data at all,
Information: No revisions on drawing.is written once instead, and the field is left empty.
| Cell value | Result |
|---|---|
[DELOMRADE][ANLAGGNINGSDEL] | <DELOMRADE value> <ANLAGGNINGSDEL value> |
Company [INNEHALL1] | Company <INNEHALL1 value> |
My fixed value | My fixed value |
[REVTAGS:BET] | C (latest revision letter) |
Rev [REVTAGS:BET] - [REVTAGS:DATUM] | Rev C - 2026-09-12 |
dwgExportis read as a plain file name (used by the export script).Authoris set from the configuration keyDwgAuthor(same for all drawings), not from Excel.
Note: a cell value without brackets (e.g. INNEHALL1) is a static value, not a column
reference. Column references must be written in brackets: [INNEHALL1].
ReturnDWGproperty (AutoLISP)
Returns DWG properties (standard + custom) to AutoLISP. It replaces DOSLib's dos_custominfo
in export scripts:
(ReturnDWGproperty "AcadExportFileName") ; -> string value, or nil if the property is missing
(ReturnDWGproperty) ; -> all properties as ((key value) (key value) ...)
A single value from the full list: (cadr (assoc "Title" (ReturnDWGproperty))).
GEOMPROPS
Opens a dockable palette, Geometrical properties, showing the total length, area and volume of the selected objects – what the Properties palette shows for one object, summed over many. It updates live as the selection changes.
EXCELPROPERTYSET (Civil 3D)
Reads PropertySets.xlsx in the same folder as the active drawing (the drawing must be saved).
Each sheet name must match a Property Set Definition in the drawing; other sheets are skipped.
| Matchname | ObjectType | Property1 | Property2 | ... |
|---|---|---|---|---|
| V-PIPE | 200 | Concrete | ... | |
| Ground | Surface | ... | ... | ... |
Matchnameis required. Objects are matched by layer name; surfaces (ObjectType=Surface) are matched by surface style name. TheObjectTypecolumn is optional.- Corridor solids on a layer named
<objectcode>_<quantitycode>are matched against each part in turn. If a part matches, the objects are moved to the matched layer when the configuration keyMoveToMatchedLayerisYes(default;Noturns it off); the layer is created if it doesn't exist. - Other column names must match property names in the Property Set Definition.
- Objects without the Property Set, or without a matching row, are skipped.
Inline functions – instead of a static value, a cell can contain an expression in brackets that is evaluated per object:
| Expression | Description |
|---|---|
[object:volume] | Volume of a 3D solid (m³) |
[object:area] | Area of a hatch, region, face or SubDMesh (m²) |
[object:length] | Length of a polyline, 3D polyline, line or arc |
[object:perimeter] | Perimeter of a region |
[object:layer] | Layer name |
[object:handle] | AutoCAD handle (unique ID) |
[calc:<expression>] | Arithmetic with column references and [object:...] |
Inside calc: "ColumnName" is the value of another column on the same row, [object:...] is an
object value, and + - * / and parentheses are allowed. The result always has 4 decimals.
[calc:"Volume (m³)"*"Density (kg/m³)"]
[calc:[object:volume]/"Area (m²)"]
[calc:"Number of layers"*[object:area]]
PROPERTYSETEXPORT (Civil 3D)
Exports all Property Sets on objects in model space to CSV files next to the drawing, one file per Property Set Definition. The drawing must be saved.
PSETSELECT (Civil 3D)
Opens a dockable palette with a tree Property Set Definition → property → value (object count) for all objects in model space. Check one or more values and click Select (replaces the selection) or Add to selection.
- Values of the same property are combined with OR, different properties with AND
(
Type = Concrete OR SteelANDThickness = 0.2). - Checking a property or a whole definition checks every value below it.
- Empty values are listed as
(empty). - The tree is scanned when the palette opens, when you switch drawings and on Refresh – not live. Click Refresh after changing Property Set values.
- With GEOMPROPS open, the total length/area/volume of the selection shows up immediately.
CORRIDORSWAPASSEMBLY (Civil 3D)
Civil 3D does not carry targets over when a region's assembly is swapped. The palette Corridor Targets → Swap assembly lets you map every old target onto a target of the new assembly.
- Click the corridor at the region to swap (Enter lists all corridors). The region of the baseline
nearest the click is chosen (within
SwapPickMaxOffsetm, default 50). When several baselines are almost equally near (withinSwapPickAmbiguitym, default 2), the candidates are listed in the tree for you to pick. Both values can be set incaDanPlugins.config. Pick region in the palette does the same; Show all lists every corridor again. You can also pick the region in the tree corridor → baseline → region. The selected region is marked with a thick magenta line (about 12 pixels at the current zoom) in the drawing until another region is picked, the swap is applied or the palette is closed. - Pick the new assembly in Assembly to switch to. Targets with the same subassembly and parameter are mapped automatically.
- Map the rest in the Map to column. It only lists targets of the same type and on the same side. The narrow column on the left shows the side: green = right, blue = left. Unmapped rows are tinted light green/light blue. Only show targets with objects hides empty targets.
- Click Apply. The assembly is swapped, the targets are set (objects plus Use same side target
and Target to), the corridor is rebuilt and a summary lists everything that was not carried over.
On an error nothing is changed; one
UNDOreverts a swap. The tab then starts over with no region, assembly or mapping selected.
Save XML / Load XML store the mapping by name (no object ids, no stations), so the same swap can be
repeated in other drawings. Loading a file switches to its assembly when the drawing has it, and lists
every mapping that does not match. Optional <Objects> in the file replace the old region's objects.
Known limitation: corridor sections in section views update only after a manual Rebuild Corridor.
CORRIDORBULKTARGETS (Civil 3D)
The tab Corridor Targets → Set targets sets one source on every matching target of the chosen regions of a corridor, instead of picking the same surface in every region.
- Pick the corridor and check regions in the tree, with All, or with Pick regions (click the corridor at each region, Enter ends). Nothing is checked to begin with. Checked regions are marked in magenta in the drawing.
- Targets are grouped by type ▸ parameter, with the number of subassemblies and regions. Show limits the group list to one type (e.g. only Offset); the list at the bottom still shows everything Apply will set.
- Choose a source in Set to. It lists the drawing's surfaces (surface targets), alignments
(offset targets) and profiles (elevation targets), plus:
- Choose layer... (offset/elevation targets): a dialog with every layer of the drawing (no xref layers) and a search box. The number is the usable objects on the layer.
- Pick in drawing... (
CBTPICKSOURCE): click an alignment, surface or profile to use it, or a polyline/feature line and chooseLayer(default, the whole layer) orObject(that object only). Objects in xrefs and objects of the wrong type are rejected.
- Only empty targets (default) sets targets without objects only; Overwrite all replaces them. (none) - remove the target in Set to removes the objects from every target of the group that has any (whatever the mode).
- The list at the bottom shows every target that changes (side, subassembly, parameter, current → new), colored as in Swap assembly. Click a column header to sort; the check box in the header checks or unchecks all rows.
- Click Apply. Everything is set in one transaction and the corridor is rebuilt once. The command
line lists what changed and what could not be set. On an error nothing is changed; one
UNDOreverts it all. The tab then starts over, as Refresh does.
SUPERELEVATIONPLAN (Civil 3D)
Sets the superelevation of an alignment by picking sections in plan and typing the cross slope of each lane in a table, instead of Civil 3D's curve-based tools. Civil 3D interpolates linearly between the rows, so a superelevation transition is two rows.
- Run
SUPERELEVATIONPLANand select the alignment (later also with Pick alignment). Its critical stations are read into the table; without superelevation the table starts with the start and end section atSuperelevationDefaultSlope(-2.5 %). - Click Add sections. A section line follows the cursor, at right angles to the alignment and as long on both sides (left half blue, right half green), with the station next to it. Each click adds a row; its slopes are interpolated from the rows before and after, so you only change what differs. Enter ends.
- Type the slopes in percent: Left Outside, Left Inside, Right Inside, Right Outside, read left to right
in the stationing direction. Negative falls away from the centerline. The station can be edited too;
rows are always sorted on station.
- Show: turns slope columns on and off, e.g. only Outside on both sides.
- Ctrl+C / Ctrl+V (or right-click) copy and paste: one value goes into every selected cell, a block (e.g. from Excel) goes in from the current cell.
- Tab, Enter and the arrow keys move between cells.
- Clicking a row marks its section in the drawing. Delete rows removes the rows of the selected cells.
- The drawing shows the table, redrawn after every change: each row is a white section line with the slope of
each side as text: negative (normal fall outwards) in cyan, positive (outer edge higher, with a "+") in red;
with both lanes shown it reads "In … / Out …". They are temporary, stay through pan and zoom and disappear on
REGENand after Apply; Show slopes shows them again. - Rows not yet on the alignment are colored (left blue, right green). Click Apply: the table replaces the alignment's critical stations in one transaction, and the colors disappear for every row the alignment now holds. Stations Civil 3D won't remove (Begin/End Alignment, the first station of a superelevation curve) get the slopes of the row at their station. An empty table removes the superelevation. Only problems are listed, on the command line; on an error nothing is changed.
Apply replaces superelevation calculated by Civil 3D; the palette says so above the table when the alignment has any.
CODESETSTYLEEXPORT / CODESETSTYLEIMPORT (Civil 3D)
Export – pick a Code Set Style (or All Code Set Styles). Each style gives three CSV files
next to the drawing: <code set style>_POINT.csv, _LINK.csv and _SHAPE.csv. The separator
follows the Windows regional settings.
Each type only has the columns that apply to it, in the order of the Code Set Style dialog:
| Type | Columns |
|---|---|
| POINT | Code, Description, Style, LabelStyle, FeatureLineStyle, PayItem, Classification |
| LINK | Code, Description, Style, LabelStyle, RenderMaterial, MaterialAreaFillStyle, PayItem, Classification |
| SHAPE | Code, Description, Style, LabelStyle, RenderMaterial, MaterialAreaFillStyle, Classification |
<default>and<no codes>are written in theCodecolumn as shown in the dialog.- One Pay Item per code, for POINT and LINK only. Civil 3D does not support Pay Items on Shape codes through its API – quantities for shapes are handled with Quantity Takeoff Criteria.
Import – reads an Excel file (.xlsx/.xls) with the sheets POINT, LINK and
SHAPE (paste the exported CSV files in as sheets).
- A missing sheet gives a warning – the codes of that type are left unchanged.
- If any code has a Pay Item, the command asks for a Pay Item file (CSV with a header row and the Pay Item ID in the first column). The dialog starts at the Pay Item file the drawing already uses (QTO Manager). The selected file is loaded into Civil 3D and saved in the drawing – Civil 3D only accepts Pay Item IDs that exist in the loaded file. Pay Items missing from the file are listed as warnings and are not set.
- Enter the Code Set Style name (default: the Excel file name). If the style exists, the command asks whether to overwrite it.
- For each sheet, all existing codes of that type are removed and read in again (
<default>and<no codes>are updated). - Styles missing in the drawing are created with default settings: Link/Marker/Shape Style, Link/Marker/Shape Label Style, Feature Line Style, Render Material and Material Area Fill Style (which is a Shape Style). Existing styles are used as they are.
- An empty
PayItemcell clears the Pay Item. A PayItem column on the SHAPE sheet gives a warning. - Summary: number of imported POINT/LINK/SHAPE codes, created styles and warnings per row.
Note: Excel turns codes like 001 into the number 1. Format the Code column as Text
before pasting the CSV data.
EXPORTGEOJSON (Civil 3D)
Exports selected closed polylines as GeoJSON polygons in WGS84 (EPSG:4326) to a project file for the website map. The source is the coordinate system assigned to the drawing (Drawing Settings → Units and Zone). The drawing is never changed.
- Select polylines (objects selected before the command are used). Only closed LWPOLYLINEs are
exported. Open polylines, old-style 2D polylines, 3D polylines and degenerate shapes are skipped
and counted. Old-style polylines give the message Convert polyline to LWpolyline …: run
CONVERTPOLYon them and export again. If nothing can be exported, the command stops right away and writes nothing. - Enter the project name.
- Save the file. The Save As dialog suggests a file name from the project name
(
Väg 616 GC-väg genom Gäddvik→vag-616-gc-vag-genom-gaddvik.geojson) and opens in the folder you used last time, or the drawing's folder. You can change both name and folder. - If the file already exists, choose
Replace,Add(for a project exported in several runs) orCancel. The dialog itself doesn't ask about overwriting.
- Arcs are split into short straight segments (max 0.01 drawing units from the true arc).
- Each polygon has exactly one attribute:
name. - Coordinates are written as longitude, latitude with 6 decimals (about 0.1 m).
- The previous version of the file is kept as
.geojson.bak. A file that isn't valid GeoJSON is never overwritten, and if the folder (for example a network share) can't be reached, the existing file is left as it was.
Supported coordinate systems:
| Country | System | EPSG |
|---|---|---|
| Sweden | SWEREF 99 TM | 3006 |
| Sweden | SWEREF 99 local zones (12 00 … 23 15) | 3007–3018 |
| Lithuania | LKS94 / Lithuania TM | 3346 |
| Latvia | LKS-92 / Latvia TM | 3059 |
| Estonia | L-EST97 | 3301 |
| Baltic states | ETRS89 / UTM 34N, 35N | 25834, 25835 |
If the drawing has no coordinate system, or one that isn't in the list, the command stops with a message and nothing is exported.
Configuration
At first run, caDanPlugins.config is created next to the plugin DLL with default settings:
# Paths
ScriptFolder=C:\CAD\2025\_General\Scripts # Default folder (MULTISCRIPT)
QuantityCodingPath=C:\CAD\2025\SE\Templates\QTO\RPSWE_Quantities - AMA23.csv # Reserved, not read yet
# Settings
DefaultPointLayer=_3Dpoint # Layer suffix for points (BLOCK2POINT), e.g. LAYER -> LAYER_3Dpoint
# Block names
SegmentBlockName=_SEG # POLYSEG
AreaBlockName=_area # POLYCALC
ElevationBlockName=_zniv # ELEVATIONBLOCK
# DWG properties
DwgAuthor=Reaalprojekt # Author (UPDATETITLEBLOCK)
# Property sets (Civil 3D)
MoveToMatchedLayer=Yes # EXCELPROPERTYSET: move to matched layer (Yes/No)
# Swap assembly (Civil 3D)
SwapPickMaxOffset=50 # CSAPICKREGION: max distance (m) from a baseline
SwapPickAmbiguity=2 # CSAPICKREGION: baselines closer than this are listed as candidates
# Superelevation (Civil 3D)
SuperelevationDefaultSlope=-2.5 # SUPERELEVATIONPLAN: slope (%) of a new table without superelevation
SuperelevationMaxSlope=15 # SEPAPPLY: largest allowed slope (±%)
SuperelevationStationRound=0.001 # SEPADDSECTIONS: rounding of a picked station (m)
SuperelevationSectionHalfWidth=7 # Section line in the drawing: length (m) to each side
SuperelevationTextHeight=1 # Slope text in the drawing: height (m)
# Attribute tags (POLYSEG)
SegmentLengthTag=LANGD
SegmentRadiusTag=RADIE
SegmentLayerTag=LAGER
# Hatching (POLYCALC)
AreaHatchPattern=ANSI31
AreaHatchScale=1.0
# Advanced
BaseTextHeight=2.5 # Base text height for elevation blocks
# Autodesk Construction Cloud
ACC_WorkspacePath=C:\ADSK\ACCDocs # required for ACCTEST: local Desktop Connector root
ACC_HubId=<hub id> # optional: detected from the path
ACC_CallbackPort=8080 # optional: port for the sign-in callback