Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Get floor location

Anonymous

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
Reply
1,128 Views
1 Reply
Reply (1)

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