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.
Support Forum
- Forum
- CAD Parametrische Modellierung
- PythonParts
[Frage] "Not enough Memory" when deleting PythonPart
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:
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