Extracting co-ordinates from geometry of room or any other structure

Anonymous

Extracting co-ordinates from geometry of room or any other structure

Anonymous
Not applicable

Hi,

I am a newbie in using C# and Revit API programming for creating plugins.
 
I am trying to retrieve co-ordinates of any structure. Let's say, for a room with four walls, I need to retrieve the co-ordinates of the four corners and write them to a text file. 
 
I have used a wall filter to extract the elements and then applied get_Geometry() method on each element.
This approach gives me a lot of duplicate co-ordinates.
I have tried the same way for using different filters for roofs, floors, doors and windows.
 
I don't know for sure whether I am correct or not. 
Please let me know if this a correct way of extracting the co-ordinates of any structure.
If there is a better and more correct method to do it, please let me know.
 

 

0 Likes
Reply
Accepted solutions (1)
977 Views
2 Replies
Replies (2)

jeremytammik
Autodesk
Autodesk
Accepted solution

Your approach sounds fine to me.

 

Duplicate corrdinates are to be expected, of course.

 

You can eliminate them in many ways.

 

The easiest, I find, is to implement a fuzzy point equality comparer and then add the points as keys to a dictionary.

 

I think I do that in my concrete setout point add-in:

 

http://thebuildingcoder.typepad.com/blog/2014/11/concrete-setout-points-for-revit-structure-2015.htm...

 

I also demonstrate this approach in many other samples on The Building Coder.

 

Search for XyzEqualityComparer, for instance.

 

Cheers,

 

Jeremy



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

Anonymous
Not applicable

Thank you Jeremy.

I will look into the code for the removal of the duplicate points.


@Anonymous wrote:

Your approach sounds fine to me.

 

Duplicate corrdinates are to be expected, of course.

 

You can eliminate them in many ways.

 

The easiest, I find, is to implement a fuzzy point equality comparer and then add the points as keys to a dictionary.

 

I think I do that in my concrete setout point add-in:

 

http://thebuildingcoder.typepad.com/blog/2014/11/concrete-setout-points-for-revit-structure-2015.html

 

I also demonstrate this approach in many other samples on The Building Coder.

 

Search for XyzEqualityComparer, for instance.

 

Cheers,

 

Jeremy


 

0 Likes