I tried to get the StructuralSection object using the new Revit 2015 Structural section properties API method "FamilyInstance.Symbol.GetStructuralSection()". But this method is always returning null object.
Has anybody tested this API? Is this API working?
Please help me to overcome from this issue and see the the attached Revit command class file (zip file) and Revit model file, which are used for this sample.
In fact, for 2015, the HasStructuralSection method only confirm if the symbol CAN have a structural section.
If so, then you need to set the structural section, but for 2015, only StructuralSectionPipeStandard and StructuralSectionRoundHSS are exposed.
Hi augusto.goncalves,
Thanks for your response.
As you suggested, I tried with StructuralSectionPipeStandard. Still it is not working. Please see the below code snippet and the attached Revit family file used for this test.
The method "fi.Symbol.GetStructuralSection()" is always returning null, though the method "fi.Symbol.Family.HasStructuralSection()" is returning TRUE.
Please post / send, if you have any working sample.
Code
FilteredElementCollector collector = new FilteredElementCollector(document); collector = collector.OfClass(typeof(FamilyInstance)); List<FamilyInstance> elementList = collector.Cast<FamilyInstance>().ToList(); foreach (FamilyInstance fi in elementList) { if (fi.Symbol.Family.HasStructuralSection()) { StructuralSectionShape shape1 = fi.Symbol.Family.StructuralSectionShape; StructuralSection ss = fi.Symbol.GetStructuralSection(); // This method is always returning null. if (ss == null) continue; StructuralSectionShape shape = ss.StructuralSectionShape; string shapeName = ss.StructuralSectionShapeName; } }
And here is a sample code: http://adndevblog.typepad.com/aec/2014/07/structural-section.html
It would be greatly appreciated if the remainder of the shapes will be made available for 2016.
Thanks,
Jon