2016-06-28
12:02 PM
- last edited on
2023-07-12
09:06 PM
by
Doreena Deng
short cnt;
ACAPI_Attribute_GetNum(API_BuildingMaterialID, &cnt);
cnt++;
for (short i = 1; i < cnt; i++)
{
API_Attribute attr;
BNZeroMemory(&attr, sizeof(API_Attribute));
attr.header.typeID = API_BuildingMaterialID;
attr.header.index = i;
err = ACAPI_Attribute_Get(&attr);
if (err != NoError)
continue;
API_BuildingMaterialType bm = attr.buildingMaterial;
if (!bm.id->IsEmpty()) // <----------- crashes when accessed
//...
//...
}
This is for both AC18 and AC19.2016-07-01 04:42 AM
GS::UniString attrId;
ACAPI_Attribute attr;
BNZeroMemory (&attr, sizeof (attr));
attr.header.typeID = API_BuildingMaterialID;
attr.header.index = ….;
attr.buildingMaterial.id = &attrId;
if (ACAPI_Attribute_Get (&attr) == NoError)
{
//... code here ...
}
This works similarly for ‘manufacturer’ and ‘description’.