Migrating Python Scripts to Plant 3D 2022+

21 April 2022AutoCAD, Industrial and Plant, plant 3d

Partager

Migrating Python Scripts to Plant 3D 2022+

As covered in a previous post about migrating to 2022, AutoCAD Plant 3D has new behavior with how it handles shared content. In addition to loading the larger files like variants.zip, and the metadata folder from within the installation directory (C:Program FilesAutodeskAutoCAD 2022PLNT3DContentScripts), Plant 3D now uses Python 3.7 when running custom scripts.

For companies maintaining installations of 2021 or earlier alongside newer versions, you’ll need to duplicate the shared content folder:

K:CADPlant3D2021 Catalogs

K:CADPlant3DCatalogs

To get your Python scripts, you’ll need to migrate your existing script to a new Python version (3.7.9).

Plant 3D 2022 What’s New

You can use a tool like the following to convert the scripts: https://docs.python.org/3.7/library/2to3.html

Once you convert the scripts, put them in the CustomScripts folder (like normal), and run PLANTREGISTERCUSTOMSCRIPTS

After PLANTREGISTERCUSTOMSCRIPTS is run, the standard ScriptGroup.xml, variants.map, and variants.xml will be created.

At the same level as your custom scripts, Plant 3D will create a __pycache__ file which stores the compiled Python by version.


If you have questions about using Plant 3D, contact Applied Software today and talk to an industry expert.


New call-to-action

Tech Tip: Creating .PC3 Plotter File for AutoCAD Electrical Drawings

5 April 2023Architecture and Engineering, AutoCAD, autodesk, ElectricalTodd Schmoock

To get a good plot in AutoCAD Electrical, creating a .pc3 file will help you print the project files the…

System Requirements for AutoCAD 2024 including Specialized Toolsets

3 April 2023AutoCAD, autodesk, IT Services, Services & SupportCarol Dunn

Autodesk announced the system requirements for AutoCAD 2024 on March 28, 2023.

Tech Tip: AutoCAD Electrical Project Batch Plotting

22 March 2023AutoCAD, autodesk, Electrical, Fabrication, MEP, Services & SupportTodd Schmoock

There are two options for plotting a project in AutoCAD Electrical; they are located in the Publish/Plot tool in the…