The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy, rmasaki

By Brendan Hack

I'm trying to work out how to reserve the library in Teamwork mode via the API in the same way you can using the normal Reserve button in the Library Manager Dialog. None of the strings in the ACAPI_TeamworkControl_FindLockableObjectSet documentation seem appropriate. is it possible to reserve this via the API?
User avatar
By Tibor Lorántfy
Hi Brendan,

At first could you clarify please what you want to reserve exactly?
  1. In the Library Manager you can reserve "the list of libraries" at the "Libraries in Project" tab. After you reserved this, you will be able to add new libraries to the project or unload any library.
  2. At the "Embedded Library" tab you can reserve the complete Embedded Library or any subfolder or any item separatly inside the Embedded Library.
The first one is currently not possible via API, I can add it as a feature request.
The second one is possible via API by using the ACAPI_TeamworkControl_ReserveLockable function after getting the necessary GUIDs from ACAPI_Environment (APIEnv_GetLibPartRefGuidID, ...). You can find an example for this in Teamwork_Control example Add-On, search the ReserveOrRelease_EmbeddedLibraryFolder function.

By Brendan Hack
Hi Tibor,

Can't believe I missed that in the Teamwork_Control example! The folder reservation is exactly what we need.

The first item you mentioned is what we were actually trying first, we have an LCF that we want to import into a project. But as this doesn't even seem to be possible via the GUI in Teamwork so we're extracting the LCF and importing the gdls inside it manually. We can do this since we have complete control over the creation of the LCFs so know what will be in them.

Will let you know how it goes.


By Brendan Hack
Hi Tibor,

I'd like to make the feature request for #1 thanks. In my 'Programatically loading GDL not importing surfaces' thread we've found the only way we get our script to execute is via a pair of APIEnv_GetLibrariesID/APIEnv_SetLibrariesID calls which fails in teamwork since we can't programatically reserve the library. Unless there's another way to force our GDL script to run we'll need this to be able to have our import plugin work without manual user intervention.