← Inbox

C3D-AUTOLOAD · Auto-load plugin at Civil 3D startup (registry) done

ENVIRONMENT CHANGE, not a drawing edit. Registered Civil3DScriptHost.dll for demand-loading so it auto-loads at Civil 3D startup - NETLOAD no longer needed each session. KEY: HKCU\SOFTWARE\Autodesk\AutoCAD\R25.0\ACAD-8100:409\Applications\Civil3DScriptHost (LOADCTRLS=2 startup, MANAGED=1, LOADER=<dll path>). UNDO: Remove-Item -Path 'HKCU:\SOFTWARE\Autodesk\AutoCAD\R25.0\ACAD-8100:409\Applications\Civil3DScriptHost' -Recurse -Force. GOTCHA: the DLL is locked by acad.exe while loaded, so rebuilding now needs Civil 3D closed (or delete the key first). Scope: current user only, Civil 3D 2025 only. See the payload for full notes.

Script file
C3D-AUTOLOAD.cs
Target
(none - environment change) · model space
Author
claude
Approved
yes · sanjay
Timeout
60s

C# payload

// ENVIRONMENT CHANGE - NOT A DRAWING EDIT. Recorded for traceability only; this script was not run
// by the plugin. The change was made directly to the Windows registry via PowerShell.
//
// WHAT WAS DONE
//   Registered Civil3DScriptHost.dll for demand-loading so it auto-loads at Civil 3D startup
//   and NETLOAD is no longer needed each session.
//
// REGISTRY KEY CREATED
//   HKCU\SOFTWARE\Autodesk\AutoCAD\R25.0\ACAD-8100:409\Applications\Civil3DScriptHost
//
// VALUES
//   DESCRIPTION (REG_SZ)    = "Civil3D Jira Script Host"
//   LOADCTRLS   (REG_DWORD) = 2      // 2 = load on application startup
//   LOADER      (REG_SZ)    = C:\dev\civil3d-jira\dotnet\Civil3DScriptHost\bin\Debug\Civil3DScriptHost.dll
//   MANAGED     (REG_DWORD) = 1      // .NET assembly, not ObjectARX
//
// TO UNDO (PowerShell):
//   Remove-Item -Path "HKCU:\SOFTWARE\Autodesk\AutoCAD\R25.0\ACAD-8100:409\Applications\Civil3DScriptHost" -Recurse -Force
//   ...then NETLOAD manually again as before.
//
// SIDE EFFECT / GOTCHA
//   The DLL is locked by acad.exe whenever it is loaded. With auto-load enabled that is EVERY
//   session, so rebuilding the plugin (MSB3027 "locked by AutoCAD") now requires either:
//     a) close Civil 3D, build, reopen   -- or --
//     b) delete the registry key above (or rename the DLL), build, then re-add it.
//
// SCOPE
//   HKCU = current user only (sanja). Not machine-wide. Civil 3D 2025 (R25.0) only; a future
//   version has a different hive (R26.0 etc.) and would need its own key.
//
// VERIFICATION
//   Launch Civil 3D and read queue/host-status.json -- loaded:true with a fresh heartbeatUtc and
//   no manual NETLOAD means it worked.

Result

Status
success
Drawing file
(none - environment change)
Message
Registry key written and verified. ENVIRONMENT CHANGE - no drawing was modified.
Entities
Duration
0 ms
Civil 3D
25.0.0.0

Log

ENVIRONMENT CHANGE - the plugin did NOT execute this script. Recorded for traceability.

WHAT: registered Civil3DScriptHost.dll for demand-loading so it auto-loads at Civil 3D
      startup. NETLOAD is no longer needed each session.

KEY CREATED:
  HKCU\SOFTWARE\Autodesk\AutoCAD\R25.0\ACAD-8100:409\Applications\Civil3DScriptHost
VALUES:
  DESCRIPTION (REG_SZ)    = Civil3D Jira Script Host
  LOADCTRLS   (REG_DWORD) = 2   (2 = load on application startup)
  LOADER      (REG_SZ)    = C:\dev\civil3d-jira\dotnet\Civil3DScriptHostin\Debug\Civil3DScriptHost.dll
  MANAGED     (REG_DWORD) = 1   (.NET assembly, not ObjectARX)
  (values read back after write - verified)

TO UNDO (PowerShell):
  Remove-Item -Path 'HKCU:\SOFTWARE\Autodesk\AutoCAD\R25.0\ACAD-8100:409\Applications\Civil3DScriptHost' -Recurse -Force
  ...then NETLOAD manually again as before.

GOTCHA: the DLL is locked by acad.exe whenever loaded. With auto-load that is EVERY session,
  so a plugin rebuild (MSB3027 'locked by AutoCAD') now requires either:
    a) close Civil 3D, build, reopen   -- or --
    b) delete the registry key above (or rename the DLL), build, then re-add it.

SCOPE: HKCU = current user only (sanja), not machine-wide.
  Civil 3D 2025 (R25.0) only - a future version uses a different hive (R26.0 etc).

VERIFY: launch Civil 3D and read queue/host-status.json. loaded:true with a fresh
  heartbeatUtc and no manual NETLOAD means it worked.

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.