icon

Foro de Soporte Allplan

CreateLibraryElement


Good day, fellow ALLPLAN enthusiasts

Cant really understand how CreateLibraryElement function works
Judging by manual it doesnt take any elements as agrument
CreateLibraryElement(doc: DocumentAdapter, insertionMat: Matrix3D, path: str, elementName: str) -> BaseElementAdapterList

Is it supposed to save everything i have in opened document in my library as symbol? Can i save some specific element to library?

Tried to use it but i have same error everytime:
AllplanBaseElements.CreateLibraryElement(self.document, AllplanGeo.Matrix3D(),path,"test.sym")
RuntimeError: unidentifiable C++ exception

Hi,

how this function is defined indicates rather, that it suppose to create elements from library in the drawing file:

  • Input arguments are the paths to a library element
  • Output is a list of created BaseElementAdapters, which are objects representing elements in the drawing file
  • The docstring says "Create a library element in the data base", where the database presumably refers to the drawing file.

So no, this is not the function you are looking for. And I also don't think, there is a function for saving an element in the library. Is this something you need to complete your project? Can you give us more details?

Best,
Bart