icon

Support Forum

Custom PythonPart Appears in Library But Won't Execute (Allplan 2024)

Schlagworte:
  • Allplan
  • 2024
  • PythonParts

Hi everyone,

I'm developing a custom PythonPart for reinforcement labeling in Allplan 2024. To troubleshoot the issue, I created a simple test script called "UltraMinimal" that just shows a message box when loaded and responds to mouse clicks. However, even this basic test won't execute.

**The Strange Part:**
✓ Built-in example PythonParts work fine (Label with pointer, etc.)
✓ When I copy example folders to my Library\PythonParts, they work
✗ My test PythonPart with identical structure doesn't work

**My Setup:**
Both files in same folder (like working examples):
```
Library\PythonParts\UltraMinimal\
├── UltraMinimal.py
└── UltraMinimal.pyp
```

The .pyp references: `<n>UltraMinimal.py</n>`

**What UltraMinimal Does (for testing):**
- Shows a message box on load: "SUCCESS! Script is loading!"
- Creates an interactor that responds to mouse clicks
- Shows another message box when you click in the drawing
- Basic structure: check_allplan_version(), create_element(), create_interactor()

**What I've Tried:**
- Verified structure matches working examples exactly
- Checked UTF-8 encoding
- Tried different path formats
- Multiple Allplan restarts
- Compared with ReinforcementExamples\Labels examples

**The Question:**
Why would built-in examples work from Library\PythonParts but not my test script using the same structure? When I click on "UltraMinimal" in the library, absolutely nothing happens - no dialog, no error, no response.

I've attached both files. The end goal is to create a reinforcement labeling tool with automatic positioning and collision detection, but I can't even get this simple test to run.

Any insights would be really helpful!

Thanks!

Anhänge (2)

Typ: text/plain
178-mal heruntergeladen
Größe: 2,85 KiB
Typ: text/xml
176-mal heruntergeladen
Größe: 750,00 B

Hi,

The *.py file must placed into a PythonPartsScripts folder (STD/USR/PRJ)

Best

Zitiert von: cmaignan
Hi,
The *.py file must placed into a PythonPartsScripts folder (STD/USR/PRJ)
Best

Hi,

Thank you for your answer. I tried that also, doesn't work at all.

Hi,

Here's a quick example of an Interactor displaying a message on mouse click (2026).

Hope you find it useful.

Best
Christophe

Anhänge (2)

Typ: text/xml
61-mal heruntergeladen
Größe: 668,00 B
Typ: text/plain
52-mal heruntergeladen
Größe: 9,27 KiB

Hi,

Thank you for trying to solve this.
Again this script does not work for me.

Firstly I put two files in the same folder, didn't work, got a notification that the script is not found[.] Then I put [.]py file in PythonPartsScripts folder, which did not gave me a warning that no script is found, but when I click on the pythonpart nothing happens[.]

I then opened the .pyp file in the notes and found this:


<?xml version="1.0" encoding="utf-8"?>

<Element xmlns:xsi='www.w3.org/2001/XMLSchema-instance'
    xsi:noNamespaceSchemaLocation='pythonparts.allplan.com/2026/schemas/PythonPart.xsd'>

My allplan is 2024, and I can not find this web page for 2024 schemas.

Then, I changed the code to:

<?xml version="1.0" encoding="utf-8"?>
<Element xmlns:xsi='www.w3.org/2001/XMLSchema-instance'
    xsi:noNamespaceSchemaLocation='pythonparts.allplan.com/2024/schemas/PythonPart.xsd'>

Again, nothing happens.

Any idea on why any pythonpart I make does nothing in Allplan?

to be able to add forum entries in XML Format it is mandatory to put the text into a

[ code ]put here xml [ /code ]

section ... (toolbar icon with <> signs

<?xml version="1.0" encoding="utf-8"?>
<Element xmlns:xsi='www.w3.org/2001/XMLSchema-instance'
    xsi:noNamespaceSchemaLocation='pythonparts.allplan.com/2024/schemas/PythonPart.xsd'>

if not, the Anti Spam Protections replaces all "." with [.] and thsi will make it unreadable

Allplan Webentwicklung

Private messages must be private. No support request via Private message.

Zitiert von: oljamilo

<Element ... xsi:noNamespaceSchemaLocation='pythonparts.allplan.com/2026/schemas/PythonPart.xsd'>

Hi,

With the 2026, PYP files are documented in an XML schema document so there is no schema for older versions.
Also with 2026 too, all the parameters in the palette are in <Parameters>.

For the file location, you can have a look at this documentation

Best