Shared coordinates

Shared coordinates

Antipin_m
Explorer Explorer
458 Views
3 Replies
Message 1 of 4

Shared coordinates

Antipin_m
Explorer
Explorer

Hello!
Can u please explain me how to compare shared coordinates between files and make sure that it is the same?

0 Likes
459 Views
3 Replies
Replies (3)
Message 2 of 4

Mohamed_Arshad
Advisor
Advisor

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)

0 Likes
Message 3 of 4

Antipin_m
Explorer
Explorer

@Mohamed_Arshad. Hi!
Thank u so much.
But this method compares shared coordinates of the BasePoints, which can be different in files, which have shared coordinates.

0 Likes
Message 4 of 4

Mohamed_Arshad
Advisor
Advisor

Hi @Antipin_m 

 

can please showcase with an example image that which you need to compare exactly with other projects


Mohamed Arshad K
Software Developer (CAD & BIM)

0 Likes