C3DExploder

Short description

🚀 C3DExploder is an AutoCAD Civil 3D C# .NET plugin project with an AutoLISP loader that converts selected Civil 3D objects into native AutoCAD geometry. The tool helps Civil 3D users create AutoCAD polylines, 3D polylines, lines, rectangles, and MText labels from supported Civil 3D entities, while logging the conversion process for QA review, drafting cleanup, and AutoCAD deliverable preparation.
image 000
image 001

Command:

📌 Main command: C3DEXPLODE.
📋 Log command: C3DEXPLODELOG opens the current daily log file in Notepad.
🧹 Clear command: C3DEXPLODECLEAR clears the in-memory session log.
📘 Version command: C3DEXPLODEVERSION prints the plugin version banner.
🎯 Single-object helper: C3DX1 is an AutoLISP wrapper that lets the user pick one object and call C3DEXPLODE.
🧰 Loading method: load C3DExploder.dll with NETLOAD, or load C3DExploder_Loader.lsp with APPLOAD so the LSP can resolve and load the DLL automatically.
📦 Required output file: C3DExploder.dll should be placed beside C3DExploder_Loader.lsp for the recommended loader workflow.
🎯 Target platform: Autodesk Civil 3D and AutoCAD with .NET Framework 4.8, x64, AutoCAD managed APIs, Civil 3D managed APIs, and Visual LISP support for the loader.

Description:

🧠 C3DExploder is a Civil 3D to AutoCAD entity converter designed for users who need to simplify Civil 3D custom objects into native AutoCAD geometry. The project includes C3DExploder.cs, EntityExtensions.cs, C3DExploder.csproj, C3DExploder_Loader.lsp, and README.md.

The main workflow starts when the user loads C3DExploder.dll directly with NETLOAD or indirectly through C3DExploder_Loader.lsp. After the plugin loads, it prints a version banner for C3DExploder v4.0.001. The user then runs C3DEXPLODE and selects Civil 3D objects to convert.

For each selected object, the command creates or reuses a target output layer based on the source layer name. Normally this layer is named with the suffix _ACAD. If the source layer name is too long, the suffix is shortened to _AX. The plugin then chooses a specialized conversion strategy when available, or falls back to a generic AutoCAD EXPLODE command route for unsupported object types.

The specialized conversion logic currently supports AeccDbFeatureLine, AeccDbSection, AeccDbSectionCorridor, and AeccDbGraphCrossSection. Feature lines are converted into Polyline3d geometry, sections are converted into Line entities when section links are available, and section views are represented as a rectangular Polyline plus an MText label. Unsupported Civil 3D objects use the generic fallback route.

This project is useful for Civil 3D design review, AutoCAD deliverable preparation, simplified CAD sharing, QA checking, drafting cleanup, and workflows where Civil 3D objects need to be represented as editable AutoCAD geometry. It does not directly modify ProfileView styles, SectionView styles, Alignment geometry, corridors, labels, bands, point groups, pipe networks, or export tables. Its main purpose is Civil 3D object conversion into AutoCAD entities.

Helper function: (if any)​

  • 📋 Logging subsystemLog.Info, Log.Warn, and Log.Error write timestamped messages to the AutoCAD command line and to persistent daily files in %APPDATA%\C3DExploder.
  • 📘 Version bannerVersionInfo.Version stores 4.0.001, and VersionInfo.Banner creates a visible load message with a timestamp.
  • 🧠 Exploder interfaceIEntityExploder defines the shared conversion contract used by each object-specific exploder strategy.
  • 📌 Feature line exploderFeatureLineExploder reads FeatureLine.GetPoints with FeatureLinePointType.AllPoints and creates a native AutoCAD Polyline3d.
  • 📐 Section exploderSectionExploder attempts to access the Civil 3D section Links collection through reflection and creates AutoCAD Line entities.
  • 🧩 Section fallbackSectionExploder.FallbackBBox creates a closed bounding-box Polyline when section link extraction is not available.
  • 📊 Section view exploderSectionViewExploder converts AeccDbGraphCrossSection into a rectangle and an MText label using the object extents.
  • 🔄 Generic AEC fallbackGenericAecExploder commits the active transaction and calls the AutoCAD EXPLODE command for unsupported object types.
  • 🧩 Strategy registryExploderRegistry maps Civil 3D object type names to specialized exploders and returns the generic fallback when no match exists.
  • 🎨 Layer helperLayerHelper.EnsureLayer creates target output layers and copies source layer color when possible.
  • 📐 Bounding-box extensionGetBoundingBoxExtents safely reads GeometricExtents and falls back to a small origin-based box if extents cannot be read.
  • 🏷️ Safe name extensionSafeName tries to read a Civil 3D object Name property and falls back to the object handle.
  • 🔍 Civil type extensionCivilTypeName attempts to read ObjectName and falls back to the managed class name for type identification.
  • 📜 LSP DLL resolverC3DExploder:DllPath finds C3DExploder.dll relative to C3DExploder_Loader.lsp or the current drawing folder.
  • 📦 LSP NETLOAD wrapperC3DExploder:Load uses netload to load the managed DLL and reports success or failure to the command line.

Functionalities:

  • 🚀 Convert Civil 3D objects to AutoCAD geometry — selected Civil 3D entities can be represented as native AutoCAD objects for easier editing, delivery, review, and compatibility.
  • 📌 Convert feature lines — supported Civil 3D feature lines are converted into Polyline3d objects using all available feature line vertices.
  • 📐 Convert Civil 3D sections — supported sections are converted into AutoCAD Line entities when section link data is accessible.
  • 🧩 Use bounding-box fallback — when section link data is unavailable, the routine creates a rectangular Polyline from the object extents.
  • 📊 Convert section views — supported section views are represented by a rectangle and an MText label.
  • 🔄 Fallback to AutoCAD EXPLODE — unsupported object types are sent through the standard AutoCAD EXPLODE command route.
  • 🎨 Create sibling output layers — converted geometry is intended to be placed on a layer derived from the source layer with the suffix _ACAD.
  • 🔒 Copy source layer color — newly created output layers inherit the source layer color when the source layer is available.
  • 📋 Write persistent logs — conversion activity is written to daily log files under %APPDATA%\C3DExploder.
  • 📂 Open the current log fileC3DEXPLODELOG opens the active daily log file in Notepad for troubleshooting and QA review.
  • 🧹 Clear session log memoryC3DEXPLODECLEAR clears the active in-memory log list during the current AutoCAD session.
  • 📘 Print version informationC3DEXPLODEVERSION displays the plugin version and timestamped banner.
  • 🧰 Load from AutoLISPC3DExploder_Loader.lsp supports easier startup loading and exposes wrapper commands for the managed .NET commands.
  • 🧩 Extend with new converters — developers can add support for additional Civil 3D objects by implementing IEntityExploder and registering the new strategy in ExploderRegistry.
  • 🔐 Important limitation — specialized conversion is currently implemented only for feature lines, sections, section corridor objects, and graph cross sections.
  • 🔴 Generic fallback caution — the generic fallback calls EXPLODE directly on the selected original object, so it may not preserve the Civil 3D original and may not force the output onto the intended _ACAD layer.
  • 🔴 Batch processing caution — when the generic fallback route is used, the command breaks out of the object loop, so remaining selected objects may not be processed during that run.
  • 🔴 Type routing review — the command routes by ent.GetType().Name, while the project also defines CivilTypeName but does not use it in the main loop. This should be reviewed for Civil 3D object name compatibility.
  • 🔴 Build configuration requirement — the project depends on AutoCAD and Civil 3D managed references, a machine-specific props file, or the fallback AutoCAD 2024 reference paths.
  • 🔐 Platform limitation — this plugin targets Autodesk Civil 3D and AutoCAD .NET Framework workflows, not plain AutoLISP-only environments.

Result:

📘 The final result is a Civil 3D to AutoCAD conversion workflow for simplifying selected Civil 3D entities into native AutoCAD geometry. Users can select supported Civil 3D objects, generate editable AutoCAD output, create organized sibling layers, and review conversion logs. This improves productivity, reduces manual tracing, supports faster QA checks, helps prepare AutoCAD deliverables, and gives CAD teams a repeatable framework for extending Civil 3D object conversion with additional C# exploder strategies.

Images, animations etc.

image 000
image 001
Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Categories: AutoCAD_Lips
Tags: 🏷️ 3D, 🏷️ C3D_extra_menu, 🏷️ C3D_tools
0
Would love your thoughts, please comment.x
()
x