Does TopographySurface.GetBoundaryPoints guarantee point ordering?

Anonymous

Does TopographySurface.GetBoundaryPoints guarantee point ordering?

Anonymous
Not applicable

I'd like to extract consecutive boundary points of a TopographySurface, i.e., by traversing the returned List[XYZ], I'm simulating a continuous, vertex-by-vertex walk around the TopographySurface perimeter. I suspect all of this information must live in the underlying data structure, but I can't find out how to get at it, and the documentation makes no mention of ordering:

http://revitapisearch.com/html/f34dbefb-94de-43e8-967d-8662f6593dac.htm

 

I've also tried probing the Vertices member of the underlying Mesh (with a call to Geometry.GetEnumator()), but this returns boundary and interior points, also in an unknown order.

 

Anyone know how best to extract this information directly from the API, or else have insight into the order guaranteed by a call to TopographySurface.GetBoundaryPoint()?

 

Thanks in advance.

0 Likes
Reply
520 Views
3 Replies
Replies (3)

jeremytammik
Autodesk
Autodesk

Dear Klanea,

 

In the far distant past, you could not even ask the topography surface which points were interior or exterior.

 

Therefore, I implemented an add-in to determine this:

 

http://thebuildingcoder.typepad.com/blog/2011/03/toposurface-interior-and-boundary-points.html

 

The interior versus exterior predicate was later added to the API, cf. What's New in the Revit 2014 API > Reading points from a TopographySurface.

 

However, my old add-in should help provide what you need as well.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Anonymous
Not applicable

Hi Jeremy,

 

Thanks for your reply. That's a great blog post; kudos! I'll go ahead and implement a "toposurface boundary loop" utility using the underlying mesh facilities of TopographySurface. I just wanted to make sure I wasn't missing a feature/trick in the API docs! 🙂

 

Thanks again for lighting the way!

0 Likes

jeremytammik
Autodesk
Autodesk

Dear Klanea,

 

Thank you for the appreciation!

 

I am glad you find it useful.

 

The Revit API does in fact provide a method to sort a collection of curves into a contiguous loop, provided by the ExporterIfcUtils class and exercised by the RoomEditorApp sample code:

 

http://thebuildingcoder.typepad.com/blog/2015/01/exporterifcutils-curve-loop-sort-and-validate.html

 

I look forward to seeing the implementation that you come up with and will happily share that on The Building Coder as well.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder