Advanced DXF Importer — import into CIVIL NX
dxf_importImports a DXF into the open CIVIL NX model with the Advanced DXF Importer plugin's engine: the same parse, layer mapping, clean-up and write as the plugin. Nodes and elements get new ids above the model's (existing rows are never overwritten); each layer's structure group is created or added to; blank properties become the plugin's DXF default material (C40/50), section (SB 500x300) and thickness (250), created or reused by name. Previews by default (writes nothing): the plan with id ranges, groups, default properties and any unit switch. To write, call again with the same inputs, apply: true and confirmPlanHash; the model is read again and the write refused if the plan changed. The write creates a master group DXF_ # first, then the unit change, properties, nodes, elements and groups, then reads everything back to verify. The import journal is recorded so dxf_import_undo can remove exactly what it created, even after a partial failure. Inputs as for dxf_inspect, plus mergeExisting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | An https address the DXF is downloaded from, up to 25 MB (public hosts only on the website). | |
| apply | No | Write to CIVIL NX. Only after the user approved the preview. | |
| plane | No | Flat drawings only: XY → plan (global XY), XZ → elevation, YZ → side elevation. | XY |
| origin | No | Move the drawing: {mode:'none'} (default), {mode:'min'} (drawing minimum to 0,0,0), or {mode:'user', x, y, z} (metres, subtracted). Use it for OS-grid / site coordinates. | |
| dxfText | No | The DXF file's text (ASCII DXF), up to 4 MB. Use dxfBase64 for a binary DXF or an R12 file with non-ASCII layer names (the bytes then keep their code page). | |
| mapping | No | Layer mapping in the plugin's preset format (the file Save mapping writes). rules apply in order, first match wins, * and ? wildcards, case-insensitive; layers are exact names and override the rules. Per class (linear = lines/polylines/arcs/splines, face = 3DFACE/polyface/mesh, point): as BEAM|TRUSS|IGNORE (linear), PLATE|IGNORE (face), NODE|IGNORE (point); material, section (linear) or thickness (face) as an id, a name or {id,name} (omitted = the DXF default property, created on import); beta (deg); group ('{layer}' = the layer name); split (split at intersections); plate THICK|THIN; include false drops a layer. Example: {rules:[{layer:'*GIRDER*', class:'linear', as:'BEAM', material:'C40/50', section:'G1', group:'Girders'}, {layer:'DIM*', include:false}], layers:{SLAB:{face:{as:'PLATE', thickness:'Slab 250'}}}} | |
| arcChord | No | Instead of arcSegments: largest chord deviation, mm. | |
| fileName | No | Name of the drawing (default: from the URL or path, else drawing.dxf). It names the import's master group DXF_<name> #<token>. | |
| filePath | No | Local server only: a path to the DXF on this machine, up to 50 MB. | |
| dxfBase64 | No | The DXF file's bytes, base64, up to 4 MB decoded. | |
| arcSegments | No | Arcs/circles/splines: segments per full circle. | |
| planeOffset | No | Flat drawings only: metres added along the axis the drawing's normal maps to. | |
| drawingUnits | No | The drawing's units when it does not record them ($INSUNITS; R12 files never do), or to override them. | |
| mergeExisting | No | Reuse existing model nodes within the merge tolerance instead of creating new ones there (reused nodes join no group). | |
| mergeTolerance | No | Node merge tolerance, mm (clean-up). | |
| confirmPlanHash | No | planHash from the approved preview; the write is refused if the plan differs. | |
| matchModelUnits | No | As in the plugin: switch the CIVIL NX model's length unit to the drawing's (mm/cm/m/in/ft) before writing. DESTRUCTIVE when it changes the unit — the preview says so; undo switches it back. false = keep the model's unit and convert the coordinates. | |
| ignoreAnnotationLayers | No | Untick layers that are empty or mostly annotation (TEXT, DIMENSION, HATCH…), as the plugin's bulk action does. |