HI @Antipin_m
Kindly follow the below steps to compare shared coordinates between two files.
01. Open the both project documents.
UIDocument UIDoc = app.OpenAndActivateDocument(@"C:\DocStorage\Demo5.rvt");
02. Get Coordinates and compare.
UIDocument uiDoc_01 = app.OpenAndActivateDocument(@"C:\DocStorage\Demo5.rvt");
Autodesk.Revit.DB.Document doc_01 = uiDoc_01.Document;
BasePoint basePoint01 = new FilteredElementCollector(doc_01)
.OfCategory(BuiltInCategory.OST_SharedBasePoint)
.First() as BasePoint;
UIDocument uiDoc_02 = app.OpenAndActivateDocument(@"C:\DocStorage\Demo6.rvt");
Autodesk.Revit.DB.Document doc_02 = uiDoc_02.Document;
BasePoint basePoint02 = new FilteredElementCollector(doc_02)
.OfCategory(BuiltInCategory.OST_SharedBasePoint)
.First() as BasePoint;
//Get First Project Basepoint
XYZ position01 = basePoint01.SharedPosition;
//Get Second Project Basepint
XYZ position02 = basePoint02.SharedPosition;
//Compare the
if ((position01.X.Equals(position02.X) && position01.Y.Equals(position02.Y) &&
(position01.Z.Equals(position02.Z))))
{
TaskDialog.Show("Information", "Shared Coordinates of two projects are same");
}
Hope this will Helps 🙂
Mohamed Arshad K
Software Developer (CAD & BIM)