Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Structural section properties API

4 REPLIES 4
Reply
Message 1 of 5
cadsindiaadn
669 Views, 4 Replies

Structural section properties API

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.

 

4 REPLIES 4
Message 2 of 5

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
Message 3 of 5

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

 

 

 

 

Message 4 of 5

Message 5 of 5
GeomGym
in reply to: augusto.goncalves

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

 

Thanks,

 

Jon

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community