Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Get Section of FamilySymbol

mohie.morad
Contributor

Get Section of FamilySymbol

mohie.morad
Contributor
Contributor

How to get the cross section of a beam or column from the FamilySymbol? Must I collect the FamilyInstances of this FamilySymbol and then get the Geometry of a FamilyInstance? Is there a simpler way?

0 Likes
Reply
Accepted solutions (1)
537 Views
2 Replies
Replies (2)

Revitalizer
Advisor
Advisor
Accepted solution

Hi,

 

I didn't test this, but give it a try...

 

Family fam = yourFamilySymbol.Family;

if(fam.CanHaveStructuralSection())
{
	StructuralSection ss = yourFamilySymbol.GetStructuralSection();

	if(ss!=null)
	{
		// the StructuralSectionAnalysisParams property is a container object
		double area = ss.StructuralSectionAnalysisParams.SectionArea;
		// and so on...
	
		// depending of StructuralSectionShape, cast StructuralSection into a more specified object
	
		switch(ss.StructuralSectionShape) // or fam.StructuralSectionShape
		{
			case StructuralSectionShape.RectangleHSS:
			
			StructuralSectionRectangleHSS ssrhss = ss as StructuralSectionRectangleHSS;
			double height = ssrhss.height;
			// more properties to get...
			break;
			
			case StructuralSectionShape.PipeStandard:
			
			StructuralSectionPipeStandard  ssps = ss as StructuralSectionPipeStandard;
			double diameter = ssps.Diameter;
			
			break;
			
			case StructuralSectionShape.NotDefined:
			// you could analyze the geometry, as you wrote
			break;
			
		}
	}
}

There are many, many classes derived from StructuralSection class, so feel free to explore them in detail and to add them to the switch/case block.

I think the resulting geometry, the curve loops of the sections, can be reproduced by combining the available properties of each derived class, i.e. corner radii, distances, thicknesses and so on.

 

There is also another approach using REX framework:

https://thebuildingcoder.typepad.com/blog/2015/03/framing-cross-section-analyser-and-rex-in-revit-20...

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





mohie.morad
Contributor
Contributor

Thank you very much !!!

0 Likes