Beam center point

Beam center point

dchemanovSCVQB
Participant Participant
479 Views
2 Replies
Message 1 of 3

Beam center point

dchemanovSCVQB
Participant
Participant

Hello. I'm trying to find middle point of a beam.

LocationCurve locationCurve = element.Location as LocationCurve;
XYZ centerPoint = locationCurve.Curve.Evaluate(0.5, true);

I figured out that beams can be created, when curve does not fit beam actual size.

dchemanovSCVQB_0-1678176110567.pngdchemanovSCVQB_1-1678176147327.png

So my question is what is this feature for (I tried to do this for walls, but it is not possible)? Is there a way to get center point of a beam to the right in some other way.

 

Thanks in advance.

480 Views
2 Replies
Replies (2)
Message 2 of 3

moturi.magati.george
Autodesk
Autodesk

Hi @dchemanovSCVQB,

 

To get the center of the beam you can apply the steps below

 

1. Get the Geometry of the Beam Element using GeometryElement

2. Loop through the Geometry above and find the Solid objects that represent the beam's geometry. 

3. Loop through the Faces of the Solid objects that you got in step 2.

4. Get the Bounding Box of the Face in step 3 using GetBoundingBox()

5. Get the center of the Bounding Box above using the Center() method and convert it into your desired units.

 

I hope this gives you the guidance needed to achieve what you need.

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes
Message 3 of 3

snabil76
Participant
Participant

Parameter yJustification = beam.get_Parameter(BuiltInParameter.Y_JUSTIFICATION);
yJustification.Set(Convert.ToInt32(Autodesk.Revit.DB.Structure.YJustification.Center));

 

by above code you can control the beam draw location (Left , Right , Center)

0 Likes