8.2.3. Error message: „ImportError: DLL load failed
On this page
8.2.3. Error message: „ImportError: DLL load failed"
In this article you will learn how to fix the error "ImportError: DLL load failed" in AutoCAD Plant 3D. This message often occurs when the file paths for scripts exceed the permitted character length of Windows.
Prerequisites
- You have administration rights on your local computer to move file paths or adjust directories.
- Plant 3D is closed to avoid conflicts when moving files.
Step-by-step guide
-
Identify the path that is too long:
Check whether your CustomScripts are located in deeply nested directories, such as in OneDrive:
c:\users\username\onedrive\dokumente - detail engineering plant 3d\autocad plant 3d 2024 content\cpak common\customscripts\... -
Move the directory structure:
Move the CustomScripts folder to a local directory with a short path structure, for example:
C:\P3DContent\CustomScriptsResult: The path length is massively reduced, thereby circumventing the Windows limit (MAX_PATH).
- Adjust the content path in Plant 3D: Open the project settings or the content path settings in Plant 3D and point them to the new, shortened directory.
-
Run the registration command again:
In the command line of Plant 3D, enter PLANTREGISTERCUSTOMSCRIPTS again.
Result: The scripts should now load without an error message.
Important notes
- Avoid OneDrive: Avoid storing content folders in synchronized cloud directories, as these often create extremely long default paths due to the Windows folder hierarchy.
- Flat hierarchy: Always use short and flat directory paths (e.g. directly under
C:\) for your Plant 3D content. - Uniform standard: Define a uniform local path (e.g.
C:\P3DContent) for all project participants to avoid compilation errors within the team.
Troubleshooting
- Error despite short path: If the error persists, experts can enable the Windows setting for long paths (>260 characters) via group policy or the registry. However, this is only recommended if the IT infrastructure supports it; shortening the paths is the safer way.