For given Wall types, when we click on the Structure parameter, it displays a dialog which lists all the CompoundStructure layers and their associated data like Width, Function, Material, etc. It also includes checkbox which refers to a layer whose material defines the structural properties of the type for the purposes of analysis.
Using the API, we can find out which layer (index) has the checkbox checked. The following minimal lines of code shows how to access this information.
public class Command : IExternalCommand
public Result Execute(ExternalCommandData commandData,
ref string message,
foreach (Element ele in
Wall wall = ele as Wall;
CompoundStructure structure =
"Str Material Index",
Using this code, and testing it with Basic Wall Exterior – Brick on CMU Mtl Stud., the above mentioned code returns the layer with the Structural Material index to be 5. Since this is a 0-based index, it displays the expected results which we can confirm from the dialog shown above – the layer with Structure function is the 5th layer which has this check box in checked state.
If there are no layers which have the checked boxes for the Structural Material, the code included above returns a value of –1.