Get the values ​​of the properties assigned to the building material.

Call:

int ires = ac_request_special("get_build_material_value", int ibuildmatindex, string genesis, void &variable);

or
int ires = ac_request_special("get_build_material_value", string sbuildmatname, string genesis, void &variable);


Here:

ibuildmatindex - building material index,

sbuildmatname - the name of the building material.

genesis - the name of the origin of the property, for example "UP" - the property is a custom property.

variable - a variable to which the value of the requested building material parameter will be returned.

A handle to an object of type ts_table can be provided to get the value.


Example:

Read the building material of the current element, read the value of the parameter "Building material name in English" for this material and write all this into the user properties of the current element.


int bmatindex;

string bmatname, bmatid, bmatnameenglish;

// read the assigned building material for the current element

ac_request("get_element_value", "buildingMaterial");

bmatindex = ac_getnumvalue();

// get the name of this building material

err = ac_request("get_bmnamebyindex", bmatindex, bmatname, bmatid);

// get the name of this building material in English from the custom property of the building material

ac_request_special("get_build_material_value", bmatindex, "UP", "The name of the building material in English");

bmatnameenglish = ac_getstrvalue();

// write all these building material properties to custom properties of the current element

ac_request("elem_user_property", "set", "Element material name", bmatname);

ac_request("elem_user_property", "set", "Material name of the element in English", bmatnameenglish);