Allplan interactor python API – Interactor PythonParts, With the Allplan Python API you can add new functionality to Allplan to meet your personal needs.
Course Description
Allplan users can add new functions and objects to Allplan and therefore adjust the BIM software to their own working method. In addition to parametric objects and variants, recurring work steps can be automated.
Suitable for beginning programmers, through this course of 10 lectures and 3 hours of content, you’ll learn all of the ALLPLAN PythonParts fundamentals and establish a strong understanding of the concept behind object-oriented programming.
Students completing the course will have the knowledge to create functional and useful Allplan PythonPart tools.
Complete with working files and code samples, you’ll be able to work alongside the author as you work through each concept.
What is Allplan Interactor?
An interactor is a simple, single-purpose object. Interactor provides a common interface for performing complex user interactions.
This PythonPart has a simple workflow, if you select any point in the Planview, it will create the model. To support these interactive request, Allplan have another type of Pythonparts, You can find them in ‘Interactor Examples’.
Getting started! – Get python!
The required Python version is already installed together with Allplan. The standard Python installation of Allplan contains all parts of the Python framework that are required to run the PythonParts supplied by Allplan. You can find it in the Allplan program directory under …\Prg\Python.
The current Python version used by Allplan are:
- Allplan Version 2021:Â Python Version 3.8.8 (64-bit)
- Allplan Version 2022:Â Python Version 3.8.8 (64-bit)
- Allplan Version 2023:Â Python Version 3.8.8 (64-bit)
Note: Since Python package is already delivered with Allplan, you don’t need to install it separately. If you however want to install it in your environment, make sure you have the appropriate version.
INCLUDE THE TOOLS AND EXAMPLES IN LIBRARY:
There are many useful PythonPart tools and examples included in the Allplan installation. They are located in the folders:
- ….\etc\Examples\PythonParts for the pyp files
- ….\etc\PythonPartsExampleScripts for the py files
The easiest way to start using them is to include them in Allplan’s Library Palette. To do that, add the path of the pyp files to the External folder.
INSTALL THE RIGHT IDE
You can edit your Python code with a normal text editor but for a better effinciency we strongly reccomend using a proper Integrated Development Environment, or IDE. Those will help you by the development by checking and debugging your code. There are many IDEs available but in this tutorial we are going to focus on the two most common ones.
We reccommend following extensions to be installed for the development of PythonParts:
- Python: extension for code formating, refactoring, unit test and more
- Pylance: a performant, feature-rich language server for Python
- Python Indent: for correct Python intendation
- Pylint: tool for linting your python code
- Studio Icons
With Allplan PythonParts, the scripting of reinforcement is far more efficient.