Calculate the surface area of ​​an element covered by a given material.

For example, for elements of the Morph type, you can assign your own poking to different faces (hold CTRL + SHIFT and click on the desired faces - they will be selected.

Then, in the element editor, set the name of the material).

There can be any number of coverage types for the Morph element. All their areas can be obtained with this command by specifying the name of the desired material.

Call:

int ires = ac_request_special("GetMaterialSurfaceSquare", string materialname);

or

int ires = ac_request_special("GetMaterialSurfaceSquare", int materialindex);


Here:

materialname - the name of the material (not building material, but material, because coatings).

materialindex - material index.

Returns -1 if the material name is not found.


Example. Get the surface area of ​​the Morph element with the "Stair - step" coverage set.


ires = ac_request_special("GetMaterialSurfaceSquare","Stair - step");
square = ac_getnumvalue();
cout << "Step area=" << square << "\n";