8.2.3. Error message: "ImportError: DLL load failed"

8.2.3. Error Message: "ImportError: DLL load failed"

In this article, you will learn how to resolve the "ImportError: DLL load failed" error in AutoCAD Plant 3D. This message frequently occurs when file paths for scripts exceed the character length permitted by Windows.

Prerequisites

Step-by-Step Instructions

  1. Identify the path that is too long: Check if your CustomScripts are located in deeply nested directories, such as in OneDrive: c:\users\username\onedrive\documents - detail engineering plant 3d\autocad plant 3d 2024 content\cpak common\customscripts\...
  2. Move the directory structure: Move the CustomScripts folder to a local directory with a short path structure, for example: C:\P3DContent\CustomScripts

    Result: Use of a shorter path significantly reduces the length, bypassing the Windows restriction (MAX_PATH).

  3. Adjust the Content path in Plant 3D: Open the Project Setup or the Content Path Settings in Plant 3D and point to the new, shortened directory.
  4. Run the registration command again: Enter PLANTREGISTERCUSTOMSCRIPTS in the Plant 3D command line again.

    Result: The scripts should now load without an error message.

Important Notes

Troubleshooting