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.
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/
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.