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.
- 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
Hi Elias,
well, then I suppose the issue must be in the symbol itself. I would try with different ones. Beginning with those delivered with ALLPLAN.
If they also produce this error, then I would reinstall ALLPLAN completely.
If not, maybe you can modify the symbol to a point, where it doesn't produce the error anymore. Sorry, that I can't give you a direct solution, but there can be so many things wrong with that symbol. And apparently, there must be something wrong with how Python interface creates the symbol, since you don't (?) encounter this error, when placing the symbol with native ALLPLAN function.
Cheers,
Bart