Get floor location

Get floor location

Anonymous
Not applicable
1,495 Views
1 Reply
Message 1 of 2

Get floor location

Anonymous
Not applicable

I'm trying to get the location point of a floor, so I found this code on a other topic : 

 

                        LocationCurve lc = floor.Location as LocationCurve;
                        Line l = lc.Curve as Line;
                        XYZ locPts = l.GetEndPoint(0) as XYZ;

 

But i get a NullReferenceExcepetion on the second line and I Don't know how to solve it.

 

If someone has an idea.

0 Likes
1,496 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

Floor doesn't have a location object.

 

You can get the centroid from the solid of the geometry, max/min of bounding box or you can analyse the sketch boundary to determine the point you consider to be the floors location.

0 Likes