icon

Support Forum

Insert a SmartPart or Macro from a PythonPart in Allplan 2026?


Hi everyone,
I’m just starting to work with PythonParts in Allplan 2026 and I’m trying to understand if it’s possible to insert a SmartPart (.smt) or a Macro (.nmk) directly from a PythonPart.
I tried a few things but I always get an error that the element type doesn’t exist, so before wasting more time I just want to ask:
is this operation actually possible in Allplan 2026, or is it no longer supported?
Thanks!

http://www.app-easy.it | APP-Easy Architecture for Allplan

Hilfreichste Antwort anzeigen Hilfreichste Antwort verbergen

Hi,

SmartParts and PythonParts are incompatible technologies. Under the hood, the use different components to e.g. show a property palette. They will never be compatible.

I think, what is possible with Python code, is to place a SmartPart from the Library in the model without modifying its parameters (with default values).

Transition from SmartParts to PythonParts can be done only step-by-step, by refactoring the code of each SmartPart into python. But I wouldn't do it just for the idea. I would do it only, if there is some added value, that the functionalities of Python API brings and which you would like to leverage in your existing parametric objects. Otherwise, these technologies can in my opinion coexist within a project.

Cheers,
Bart

Hi,

Here the documentation for adding objects from the libray.

Please note that your PythonPart must have at least one geometric object (2d or 3d - can be in help construction) to select and apply modification on it.

Best regards
Christophe

PS example here

Hi Christophe,

thank you very much for the information and the example.

From what I understand, SmartParts are not implemented yet in PythonParts, right?
That’s a pity, because I was considering migrating some of my SmartParts to PythonParts, and being able to import a SmartPart directly would have allowed a smoother and more gradual transition.

Thanks again for your help!

Best regards,
Giorgio

http://www.app-easy.it | APP-Easy Architecture for Allplan

Hi,

SmartParts and PythonParts are incompatible technologies. Under the hood, the use different components to e.g. show a property palette. They will never be compatible.

I think, what is possible with Python code, is to place a SmartPart from the Library in the model without modifying its parameters (with default values).

Transition from SmartParts to PythonParts can be done only step-by-step, by refactoring the code of each SmartPart into python. But I wouldn't do it just for the idea. I would do it only, if there is some added value, that the functionalities of Python API brings and which you would like to leverage in your existing parametric objects. Otherwise, these technologies can in my opinion coexist within a project.

Cheers,
Bart