Write a new value to the user parameter for the current element.

Handling:

int ires = ac_request("elem_user_property","set", string sparname, bool/int/double/string value);


Here:

svarname - parameter name.

value - the default value of the parameter. The parameter type is determined by the type of the variable value passed here.

srazdel - the section in which the user variable will be created.

ires - 0 - if the variable was created successfully.

Example.

Set the new value of the logical parameter "Useful area of ​​the building" for the current element to "true".


string sUP = "Useful building area";
int istrue = 1; // The new value of the variable is 1, which means "true"
int ires = ac_request("elem_user_property","set",sUP,istrue);
if(ires==0)
{
      cout << "New value successfully set";
}


If the project has user-defined variables with the same names in different groups, for example, the "Opening width" variables are created in the "Window Variables" group and in the "Door Variables" group, then in order to access the "Opening Width" variable in the "Window Variables" group, you need to specify the group in the variable name through a double slash:

sUP = "Window Variables\\Opening Width";