Message 1 of 3
I can't retrive a StructuralSectionShape valid

Not applicable
07-15-2019
03:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The solution of https://forums.autodesk.com/t5/revit-api-forum/get-section-of-familysymbol/m-p/8495734 does't work in my case: I allways get a StructuralSectionShape.NotDefined
This is my code:
public static void GetMaterialFormaSeccion(Family family, FamilySymbol symbol, out StructuralMaterialType mater, out StructuralSectionShape shape) { StructuralSection ss = null; Parameter para = null; //Default values mater = StructuralMaterialType.Undefined; shape = StructuralSectionShape.NotDefined; if (family == null && symbol == null) return; if (family == null && symbol != null) family = symbol.Family; //Material if (family != null) mater = family.StructuralMaterialType; //1.- From family if (family != null) shape = family.StructuralSectionShape; //2.- From StructuralSection if (shape == StructuralSectionShape.NotDefined && symbol != null && (family == null || family.CanHaveStructuralSection())) { ss = symbol.GetStructuralSection(); if (ss != null) shape = ss.StructuralSectionShape; } //3.- From Parameters if (shape == StructuralSectionShape.NotDefined && symbol != null) { para = symbol.get_Parameter(BuiltInParameter.STRUCTURAL_SECTION_SHAPE); if (para != null) { if (para.StorageType == StorageType.Integer) shape = (StructuralSectionShape)para.AsInteger(); } } }
I've tried this code with many structural column families (steel and concrete ones) and allways returnes 'NotDefined'.
In particular, ss is allways null. And with STRUCTURAL_SECTION_SHAPE, Parameter, para.AsInteger() is allways zero (the value of 'NotDefined').