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: 

How To Convert Autocad Point to Revit Coordinates Using Revit API

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
3137 Views, 3 Replies

How To Convert Autocad Point to Revit Coordinates Using Revit API

Hi,

 

Basically I have "Points" created in autocad with X and Y values as seen from the screenshot below:

Note that the line connecting the points is just so when I bring this dwg file to Revit, I can pick the line and check the values of the points later.

 

cad.JPG

 

 

So, I linked the dwg file in Revit and to see the values of the "Points", I converted the line to a "Property LIne" so I can conveniently display the values using the "Spot Coordinates" tag. (as seen from the image below)

 

before.JPG

 

 

My question is, how come the values of points in Autocad differs from Revit as shown by the image above?

 

And to correct the difference, I need to "Acquire the Coordinates" and as you can see from the image below, they now match exactly.

 

after.JPG

 

 

So is there a way I can use the Revit API to programmatically 'Set" the X and Y values to create the same effect as in the last image above without having to go through the process of creating the points in Autocad, linking it in Revit and acquiring the coordinates just to get the correct X and Y values?

 

Btw, I tried to create a line using the API by using the  Line.CreateBound() method passsing in the X and Y coordinates of the dwg points but its way too far and seems not correct as if it was done using the "Acquire Coordinates".

 

So any pointers if this is possible via Revit API is greatly appreciated.

 

And just incase, I have attached the dwg and Revit file used as example for convenience.

 

Thank you.

3 REPLIES 3
Message 2 of 4
augusto.goncalves
in reply to: Anonymous

It may be too basic, but are you considering the UNITS between AutoCAD and Revit?

Revit will always use FEET on the API, but AutoCAD is unitless.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 4

Yes the units is one factor. Also, if you linked the AutoCAD file Origin to Origin, and the units were correct, then the point XYZ should match without Sharing Coordinates.




______________
Yes, I'm Satoshi.
Message 4 of 4
Anonymous
in reply to: Anonymous

The coordinates displayed using the spot coordinate tool are offset from the survey point while the internal origin is controlled by the Project Base Point, the project base point has coordinate parameters which are offsets from the survey point (more correctly though the coordinates are the inverse offset of the survey point from the project base point). The auto origin-origin option in the link cad tool places the cad model's origin at the project base point. if the survey point is not exactly on the project base point then the cad and internal api coordinates will differ from those displayed using spot coordinates. you can fix this programatically by setting the coordinate parameters of the project base point to 0,0,0 which will snap the survey point to the project base point . It's quite counter-intuitive but I'm sure there's a reason it works this way... Smiley Frustrated

 

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

Post to forums  

Autodesk Design & Make Report