icon

Das Wissen aller Anwender nutzen

Im Allplan Connect Forum tauschen sich Anwender aus, geben wertvolle Tipps oder beraten sich bei ganz konkreten Aufgabenstellungen − auch international.
Und damit wirklich keine Frage unbeantwortet bleibt, unterstützen die Mitarbeiter des Technischen Supports ebenfalls aktiv das Forum.

Es erwarten Sie:

  • Foren-Vielfalt aus CAD Architektur, CAD Ingenieurbau uvm.
  • Tipps von User für User
  • international: Deutsch, Englisch, Italienisch, Französisch und Tschechisch

Melden Sie sich jetzt an und diskutieren Sie mit!

Zur Registrierung

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

Hi Bart.

The problem i was trying solve is how to copy some elements from one drawing file to another.
As far as i know i can't use BaseElementAdapter for this because i have Precast elements (and fixtures) and API at this point cannot Read and Modify them (therefore copy?)

The idea was to select some element and save it to the library temporarily (as symbol), then open other drawing file and insert it there from library

Thanks for your input,
Suren