Get the Type ID and Variation ID from API_LibPart
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-02-12
09:08 AM
- last edited on
‎2023-07-12
09:11 PM
by
Doreena Deng
‎2016-02-12
09:08 AM
Hello the forum
I download library parts and insert them in Archicad projects.
To do the job correctly i need to know what is exactly the library part.
(a stair, a window, a door, a wall...)
For the moment i have this info in xml side-car files so i know exactly the type of the library part. I can fill in the "element.header.typeID" and "element.header.variationID" based on the data i have in my XML side-car.
But...
For some of my library parts i don't have the XML data so i don't know the type of the libpart.
How can i find "element.header.typeID" and "element.header.variationID" from a API_LibPart ?
I have the "API_LibTypeID" but this is not enough. By example, i can't know that a libpart is a "stair" by example.

I download library parts and insert them in Archicad projects.
To do the job correctly i need to know what is exactly the library part.
(a stair, a window, a door, a wall...)
For the moment i have this info in xml side-car files so i know exactly the type of the library part. I can fill in the "element.header.typeID" and "element.header.variationID" based on the data i have in my XML side-car.
But...
For some of my library parts i don't have the XML data so i don't know the type of the libpart.
How can i find "element.header.typeID" and "element.header.variationID" from a API_LibPart ?
I have the "API_LibTypeID" but this is not enough. By example, i can't know that a libpart is a "stair" by example.
Labels:
- Labels:
-
Add-On (C++)
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-02-19 10:54 AM
‎2016-02-19
10:54 AM
gehairing wrote:You could deduce this from the library part subtype,
i need to know what is exactly the library part.
(a stair, a window, a door, a wall...). [...] How can i find "element.header.typeID" and "element.header.variationID" from a API_LibPart ? I have the "API_LibTypeID" but this is not enough. By example, i can't know that a libpart is a "stair" by example.
Ralph Wessel BArch
Central Innovation
Central Innovation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-02-22 11:00 AM
‎2016-02-22
11:00 AM
Thank you for the answer...but i don't understand what you mean.
Do you mean the ownUnID can give me an element from wich i can extract typeID and VariationID ?
I have tried playing around with something like this :
Do you mean the ownUnID can give me an element from wich i can extract typeID and VariationID ?
I have tried playing around with something like this :
GS::UniString s = libPart.ownUnID; GS::Guid gs_guid(s); API_Element element; BNZeroMemory (&element, sizeof (API_Element)); element.header.guid = GSGuid2APIGuid (gs_guid); GSErrCode err = ACAPI_Element_Get(&element); if(err == NoError) { typeID = element.header.typeID; variationID = element.header.variationID; }But because i don't really know what it means i can't say why it doesn't work

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-02-22 01:02 PM
‎2016-02-22
01:02 PM
gehairing wrote:Library parts are organised in a hierarchical structure, so the 'subtype' of an object determines its parent and therefore its 'type'. If you refer to the attached image, you can see the ARCHICAD Subtype selection dialog with the Stairmaker subtype selected. This would make the object a type of 'Stair' (and also a type of 'Model Element').
Do you mean the ownUnID can give me an element from wich i can extract typeID and VariationID ?
You can use the subtype of your library parts to determine if they are descended from specific types, and therefore determine which tool they are associated with.
Ralph Wessel BArch
Central Innovation
Central Innovation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-02-23 06:26 PM
‎2016-02-23
06:26 PM
Thank you Ralph.
Sorry, I don't understand how can i access the subType you talk about ?
Sorry, I don't understand how can i access the subType you talk about ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-02-24 11:38 AM
‎2016-02-24
11:38 AM
gehairing wrote:For background information, look at the
Sorry, I don't understand how can i access the subType you talk about ?
Ralph Wessel BArch
Central Innovation
Central Innovation