Polylines_Alignments_vs.01

Short description

AutoCAD Civil 3D .NET Plugin Shadow-Copy Loader — loads a managed DLL into AutoCAD without locking the source file, enabling live rebuild-and-reload without restarting AutoCAD.
alignment creator @dan templeate v4.0.6

Command:

Command: ReloadPlugin
Trigger: Auto-runs on file load via (load "LoadPlugin.lsp")
Reload shortcut: Type ReloadPlugin in the AutoCAD command line

Description:

This AutoLISP routine solves the most common Civil 3D .NET development frustration: AutoCAD locks the DLL it has loaded, blocking Visual Studio from writing a new build. The loader copies the freshly-built DLL from a watched deploy folder into a uniquely timestamped shadow file in the Windows TEMP directory, then calls NETLOAD on that copy. AutoCAD locks the shadow copy — never the source — so your next build always succeeds. Old shadow copies are automatically pruned, keeping only the three most recent versions.

Helper function: (if any)​

  • Shadow directory creation — creates %TEMP%\@Dan_Templeate_shadow\ if it does not exist
  • Old copy cleanup — lists all @Dan_Templeate_*.dll files, sorts descending by name, deletes all but the newest three
  • Timestamp stamp builder — uses $(edtime,$(getvar,DATE),YYYYMMDD) and HH-MM-SS to generate a unique suffix per load
  • File copyvl-file-copy from the deploy folder to the stamped shadow path; aborts with an error message if the copy fails
  • NETLOAD call — loads the shadow DLL into the running AutoCAD session without blocking the deploy folder
  • Confirmation echo — prints the full shadow path to the AutoCAD command line on success

Functionalities:

  • 🔄 Hot-reload without restarting AutoCAD — rebuild in Visual Studio, type ReloadPlugin, test immediately
  • 🔒 Zero build-lock errors — MSBuild writes to deploy\, the loader reads from there; AutoCAD never touches deploy\
  • 🗂️ Automatic shadow housekeeping — TEMP folder never accumulates more than three old DLL copies
  • 📅 Timestamped loads — every loaded instance has a unique name, making it easy to correlate DevLog version stamps with file system copies
  • ⚙️ Configurable source path — one variable at the top of the file; change dll-source to match your project layout
  • 🚀 Auto-executes on load — the final line calls (c:ReloadPlugin) automatically; comment it out to switch to manual-only mode
  • 🪵 DevLog integration — the IExtensionApplication.Initialize() method called after load stamps the version banner in the integrated Dev Log panel using the DLL file creation date

Result:

After running, the Civil 3D plugin (@Dan_Templeate.dll) is live in the current AutoCAD session. All registered commands become immediately available — type DANALIGN to open the Alignment Creator, DANLOG to raise the standalone Dev Log, or DANHELP to list all commands with descriptions. The Dev Log panel inside the Alignment Creator displays a version stamp in the format 4.0.006_[creationdate]dd.mm.yyyy_hh.mm.ss confirming which build is active. No AutoCAD restart is required between builds.

Images, animations etc.

2026 06 23 12 28 12 alignment creator @dan templeate v4.0.6
alignment creator 001
alignment creator 002
Pixel

Additional info:

Share this page:

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