4.1 Script Automation, Functions in Detail
On this page
Script Automation in SuCri
Script automation enables efficient management and execution of Python scripts within your workspace. Through automated processes and specific commands, you optimize the workflow when working with custom components.
Prerequisites
To use the script automation functions, the corresponding Python scripts must be stored in the project folder and the SuCri extensions must be installed correctly.
Step-by-Step Instructions
-
Step 1: Automatic Opening of Scripts
Click on a component in your drawing. The system recognizes the origin of the component and automatically opens the associated Python script from which it was created. This allows for an immediate review or adjustment of the source code.
Expected result: The script editor opens with the corresponding file.
-
Step 2: Registration of Custom Scripts
Enter the command
PlantRegisterCustomScriptsinto the command line and confirm with Enter. This command registers all new or modified custom scripts within the application. -
Step 3: Compilation and Restart
To make changes effective system-wide, execute the command
CompileAndRestart. This command performs the registration viaPlantRegisterCustomScriptsin the background and then automatically restarts Plant 3D™.Expected result: The software restarts and all script changes are active.
Important Notes
- Backup: Save all open drawings before using the
CompileAndRestartcommand, as the application will restart without any further intermediate prompts. - Syntax: Ensure that the commands
PlantRegisterCustomScriptsandCompileAndRestartare typed into the command line exactly as specified. - Best Practice: Use the automatic opening function to quickly validate component parameters without having to search manually in the file system.
Troubleshooting
- Script does not open: Ensure that the path to the Python interpreter is correctly stored in the options and that the script file has not been moved.
- Command unknown: Check whether the SuCri module has been loaded correctly. If necessary, the installation may need to be repaired or the plugin reloaded.