Structural section properties API

Structural section properties API

cadsindiaadn
Enthusiast Enthusiast
835 Views
4 Replies
Message 1 of 5

Structural section properties API

cadsindiaadn
Enthusiast
Enthusiast

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.

 

0 Likes
836 Views
4 Replies
Replies (4)
Message 2 of 5

augusto.goncalves
Alumni
Alumni

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.

 

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 3 of 5

cadsindiaadn
Enthusiast
Enthusiast

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;
    }
}

 

 

 

 

0 Likes
Message 4 of 5

augusto.goncalves
Alumni
Alumni
0 Likes
Message 5 of 5

GeomGym
Advocate
Advocate

It would be greatly appreciated if the remainder of the shapes will be made available for 2016.

 

Thanks,

 

Jon

0 Likes