2015-06-20
10:24 AM
- last edited on
2023-07-13
03:54 PM
by
Doreena Deng
2015-06-30 11:39 AM
First, is there an official mapping the short value to the material that I wasn't able to find.Yes. There is an example on ACAPI_Attribute_Get (Example II) for this.
Second, this values will never change in future updates, can I count on the number 45 always being Glass, for example.No. Since you can modify the list on Options > Element Attributes > Building Materials... dialog.
2015-07-03 04:52 PM
GSErrCode err;
ofstream file;
API_Attribute attrib;
short n;
BNZeroMemory(&attrib, sizeof(API_Attribute));
attrib.header.typeID = API_BuildingMaterialID;
err = ACAPI_Attribute_GetNum(API_BuildingMaterialID, &n);
file.open("ListOfMaterials.txt");
for (int i = 1; i <= n && err == NoError; i++) {
attrib.header.index = i;
err = ACAPI_Attribute_Get(&attrib);
if (err == NoError) {
file << attrib.buildingMaterial.head.name << "\n";
}
if (err == APIERR_DELETED){
err = NoError;
}
}
file.close();