3 weeks ago
I want to be able to check the number of external drawings in a model. i.e DWGs/PDFs project teams have linked in.
So far I am able to do that in the model space using:
GS::Array<API_Guid> drawings; ACAPI_Element_GetElemList(API_DrawingID, &drawings); for (const auto& g : drawings) uniqueDrawings.Add(g);
Now, I want to check Worksheets & Layouts, but I cant find a way to do this.
BTW I'm very new to the Archicad API so might be missing something easy here.
Any help would be most appreciated.
Operating system used: Windows 11.26100.8037
2 weeks ago
Many API functions don't directly specify a target database, instead operating on what is designated as the 'current' database. You can change the current database by calling ACAPI_Database_ChangeCurrentDatabase, but I strongly recommend capturing the current database first (with ACAPI_Database_GetCurrentDatabase) and restoring it when finished (otherwise Archicad can behave strangely when the add-on returns control).
You can get a list of worksheet databases using ACAPI_Database_GetWorksheetDatabases. There are similar functions for other database types.