icon

Support Forum

[Frage] "Not enough Memory" when deleting PythonPart

Schlagworte:
  • Allplan
  • 2025
  • LibraryElements
  • Crash

In my testing Script (see attachment) I tried to create a simple LibraryElement and place it within a pythonpart. Placing the python part and editing it works as intendet. Once I delete it however Allplan 2025 crashes or gives me the error message "Not enough Memory". I have tried Placing my TestCube.sym locally on my PC as well which did not work.

Anhänge (2)

Typ: text/x-script.python
92-mal heruntergeladen
Größe: 1,25 KiB
Typ: image/png
4-mal heruntergeladen
Größe: 5,65 KiB

Hi,

your code

    lib_ele = AllplanBasisElements.LibraryElement(props_a)
    model_elements = ModelEleList()
    model_elements.append(lib_ele)
    
    pyp_util.add_library_elements(lib_ele)
    python_part = pyp_util.create_pythonpart(build_ele)
    return CreateElementResult(python_part)

adds a child element to the created PythonPart, but does not specify any view (in ALLPLAN terminology also known as a slide of a smart symbol). I am not sure, but that might be the issue. See here, in particular this remark:

If the PythonPart should solely consist of a library element, it is advisable to create at least a bounding box around it as an unprintable help construction and add it to the PythonPart container with add_pythonpart_view_2d3d. As a result, the user is still able to modify the PythonPart by double-click on the bounding box, whereas the library element remains a child-element of the PythonPart.

Cheers,
Bart

Hi Bart,

thank you for your answer.

As i understand it, add_pythonpart_view_2d3d in this context concerns only the bounding box. Regardless I have tried it on the Library Element and the error still occurs. Sometimes Allplan crashes completely. I have now also tried using the example script given in... https://github.com/NemetschekAllplan/PythonPartsExamples/blob/2025/PythonPartsExampleScripts/BasisExamples/UserObjects/SymbolLibraryElement.py
... but yet again the same error still occurs.

Regards,
Elias