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: 

Is there a way to switch between Internal and Shared coordinates in Revit API?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
1234 Views, 2 Replies

Is there a way to switch between Internal and Shared coordinates in Revit API?

First, I exported the Revit files to Navisworks by choosing the "Shared" option for coordinates. After assembling everything in Navisworks and checking for clashes using the Navisworks' Clash Detective plugin, I'm trying to insert a family (it's just a pink sphere) at the clash points in Revit using the Document.Create.NewFamilyInstance() method. But the problem is that when pass the XYZ values taken from Navisworks into Document.Create.NewFamilyInstance()  method, my sphere ends up being not where I want it to be.

I already tried converting meters to feet, the sphere still ends up being not where I want it to be.

ClashPoint.PNG

 

Tags (2)
2 REPLIES 2
Message 2 of 3
Moustafa_K
in reply to: Anonymous

Hi,

I think you need to transform this point to the model space. try the following (not sure it will work for you, but this is from what you explained)

 

var translatedpoint = doc.ActiveProjectLocation.GetTotalTransform().Inverse.OfPoint(mypoint);

now the translatedpoint is what "Should" point to the right location

 

also you can have more information about shared parameter via Revit API from here:

https://wrw.is/shared-coordinates-and-the-revit-api/

 

 

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
Message 3 of 3
FilipNekic
in reply to: Anonymous

Thanks @Moustafa_K for hint, In my case thare was no need for Inverse Transform.

 

XYZ PointInSharedCoordinates_Meters = new XYZ(-28.716, 88.5806, -0.4432);

double x = UnitUtils.ConvertToInternalUnits(PointInSharedCoordinates_Meters.X, DisplayUnitType.DUT_METERS);
double y = UnitUtils.ConvertToInternalUnits(PointInSharedCoordinates_Meters.Y, DisplayUnitType.DUT_METERS);
double z = UnitUtils.ConvertToInternalUnits(PointInSharedCoordinates_Meters.Z, DisplayUnitType.DUT_METERS);

XYZ PointInSharedCoordinates_Feet = new XYZ(x, y, z);

XYZ InternalPoint = doc.ActiveProjectLocation.GetTotalTransform().OfPoint(PointInSharedCoordinates_Feet);

 

Kind Regards,

Filip Nekic
BIM Consultant
https://bimclinic.com/

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

Post to forums  

Rail Community


Autodesk Design & Make Report