Announcements

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

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: 

Get floor location

1 REPLY 1
Reply
Message 1 of 2
Anonymous
1128 Views, 1 Reply

Get floor location

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.

Labels (3)
1 REPLY 1
Message 2 of 2
RPTHOMAS108
in reply to: Anonymous

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.

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

Post to forums  

Autodesk Design & Make Report