[SOLVED] From .gsm file to embedded library
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2017-09-16
07:21 PM
- last edited on
ā2022-12-06
02:01 PM
by
Daniel Kassai
ā2017-09-16
07:21 PM
What would be the best way to store a .gsm file as a new API_LibPart object in embedded library?
Is it possible to fill LibPart sections from gsm file?
Currently I am adding a new linked library APIEnv_AddLibrariesID, search for object by name with ACAPI_LibPart_Search and copy sections manually to a new libpart created with ACAPI_LibPart_Create... which is a bit tedious, besides I cannot remove linked /tmp/ library.
Is it possible to fill LibPart sections from gsm file?
Currently I am adding a new linked library APIEnv_AddLibrariesID, search for object by name with ACAPI_LibPart_Search and copy sections manually to a new libpart created with ACAPI_LibPart_Create... which is a bit tedious, besides I cannot remove linked /tmp/ library.
BIMquants.comBETA - Quantities and Costs Estimation in Archicad - BETA testers needed.
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2017-09-17 10:12 AM
ā2017-09-17
10:12 AM
Found a solution:
IO::Location rab("C:/GDLTest/11204.gsm"); GSErrCode err; auto folderId = API_SpecFolderID::API_EmbeddedProjectLibraryFolderID; IO::Location embeddedLibraryFolder; if (ACAPI_Environment(APIEnv_GetSpecFolderID, &folderId, &embeddedLibraryFolder) == NoError && IO::Folder(embeddedLibraryFolder).GetStatus() == NoError) { // copy file to embedded folder IO::Location destFolder = embeddedLibraryFolder; destFolder.AppendToLocal(IO::Name("11204.gsm")); err = IO::fileSystem.Copy(rab, destFolder); API_LibPart libPart; BNZeroMemory(&libPart, sizeof(API_LibPart)); libPart.typeID = APILib_ObjectID; libPart.location = &destFolder; err = ACAPI_LibPart_Register(&libPart); }
BIMquants.comBETA - Quantities and Costs Estimation in Archicad - BETA testers needed.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2017-09-18 08:54 AM
ā2017-09-18
08:54 AM
vuego wrote:Alternatively, you can create a new library part (ACAPI_LibPart_Create), that puts it directly into the embedded library. Also, you can assemble the library part with ACAPI_LibPart_AddSection or ACAPI_LibPart_NewSection calls.
Found a solution:
...
Best, Akos