We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-09-22 04:01 AM - last edited on 2024-09-17 01:16 PM by Doreena Deng
I would like to extract the composite name from walls, slabs, and roofs using the API. I have got all the other information I need (dimensions, instance name, etc) but I am struggling to find where to get composite info. I have attached 2 screenshots showing what I need to get.
Could someone point me to where this value is held?
Thanks in advance.
Solved! Go to Solution.
2023-09-22 11:24 AM - edited 2023-09-22 11:28 AM
The Composite is in element specific structs
here is a example of the wall:
https://archicadapi.graphisoft.com/documentation/api_walltype?s=API_WallType
you get the Attribute Index and with ACAPI_Attribute_Get you should be able to mangle to the name of the composite
2023-09-22 11:24 AM - edited 2023-09-22 11:28 AM
The Composite is in element specific structs
here is a example of the wall:
https://archicadapi.graphisoft.com/documentation/api_walltype?s=API_WallType
you get the Attribute Index and with ACAPI_Attribute_Get you should be able to mangle to the name of the composite
2023-09-24 08:44 PM
Thanks very much
2024-01-11 11:24 AM
Happy New year @YourQS and @Joel Buehler .
Please I need help. I am new to App Development using Archicad C++ API. I am trying to extract some basic information from the AC Database and specific Elements.
Please, I have tried to extract some Building Material Attribute information, particularly the ID, Manufacturer, and Description, but my code always returns empty. Please, I need help. I've attached the information I need and the snippet of the line of code I have been using.
API_Attribute attrib = {};
GSErrCode err;
BNZeroMemory(&attrib, sizeof(API_Attribute));
attrib.header.typeID = API_BuildingMaterialID;
attrib.header.index = 4;
err = ACAPI_Attribute_Get(&attrib);
if (err == NoError) {
/*Extracting GS::UniString values*/
const GS::UniString theGuid = APIGuid2GSGuid(attrib.buildingMaterial.head.guid).ToUniString().ToCStr().Get();
const GS::UniString idString = attrib.buildingMaterial.id ?
GS::UniString(*attrib.buildingMaterial.id).ToCStr().Get() : GS::UniString();
const GS::UniString manufacturerString = attrib.buildingMaterial.manufacturer ?
GS::UniString(*attrib.buildingMaterial.manufacturer).ToCStr().Get() : GS::UniString();
const GS::UniString descriptionString = attrib.buildingMaterial.description ?
GS::UniString(*attrib.buildingMaterial.description).ToCStr().Get() : GS::UniString();
/*Displaying extracted values*/
ACAPI_WriteReport("Building Material Information:\nGuid: " + theGuid +
"\nID: " + idString + "\nManufacturer: " + manufacturerString +
"\nDescription: " + descriptionString, true);
2024-01-11 09:56 PM
Hi Appolos,
Where do you get the index from in the line
attrib.header.index = 4
Magic numbers like this are generally frowned upon, because others don't know what they mean.
2024-01-12 11:06 AM - last edited on 2024-01-15 01:55 AM by Laszlo Nagy
Hello @YourQS thank you for your response.
Pardon me for not adding comments to the line of code. NOTE: As I mentioned earlier I am new to using the Archicad C++ API.
The "attrib.header.index" specifies the index value of the attribute. I observed that in the Attribute Manager documentation (see the picture).
I wanted to extract the attributes of all the Building Materials within the Archicad Database (as is) therefore I thought iterating through the index was the best way.
I got results (e.g. Guid, name, connPriority, cutFill, cutFillBackgroung, etc) but I could not access the ID and manufacturer.
If you have a better suggestion and advice I await your response.