How to access manufacturer data in Building Material
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-01-15
11:20 AM
- last edited on
2021-09-14
01:35 PM
by
Noemi Balogh
2021-01-15
11:20 AM
Hello,
I am currently trying to work with Building Materials.
First, I create a Building material and add it to the list. This works fine and all the information is there (including ID, manufacturer, description). However, when I try to access those, they are all NULL.
https://imgur.com/a/ZXjOfGI
Here is how I access the Building Materials:
I am currently trying to work with Building Materials.
First, I create a Building material and add it to the list. This works fine and all the information is there (including ID, manufacturer, description). However, when I try to access those, they are all NULL.
Here is how I access the Building Materials:
err = ACAPI_Attribute_GetNum(API_BuildingMaterialID, &count); if (err != NoError) return materials; for (i = 1; i <= count; i++) { BNZeroMemory(&attrib, sizeof(API_Attribute)); attrib.header.typeID = API_BuildingMaterialID; attrib.header.index = i; err = ACAPI_Attribute_Get(&attrib); }My question is what is the problem here? Why are those properties NULL?
Labels:
- Labels:
-
Add-On (C++)
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-01-16 06:38 PM
2021-01-16
06:38 PM
In case of id, manufacturer and description parameters Archicad fills these values only if they are pointing to an existing GS::UniString object. In your code all of them are null pointers, so they don't filled.
You can use something like this to make it work (it accesses only the manufacturer data, but should work for the other two as well):
You can use something like this to make it work (it accesses only the manufacturer data, but should work for the other two as well):
API_Attribute attrib; BNZeroMemory (&attrib, sizeof (API_Attribute)); attrib.header.typeID = API_BuildingMaterialID; attrib.header.index = attributeIndex; GS::UniString manufacturer; attrib.buildingMaterial.manufacturer = &manufacturer; ACAPI_Attribute_Get (&attrib);