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: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
abhijitdesale
780 Views, 2 Replies

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

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.
 

 

2 REPLIES 2
Message 2 of 3

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

Message 3 of 3

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


 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community