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: 

Shared coordinates

3 REPLIES 3
Reply
Message 1 of 4
Antipin_m
291 Views, 3 Replies

Shared coordinates

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

3 REPLIES 3
Message 2 of 4
Mohamed_Arshad
in reply to: Antipin_m

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 🙂

 

Thanks & Regards,
Mohamed Arshad K
Message 3 of 4
Antipin_m
in reply to: Mohamed_Arshad

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

Message 4 of 4
Mohamed_Arshad
in reply to: Antipin_m

Hi @Antipin_m 

 

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

Thanks & Regards,
Mohamed Arshad K

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

Post to forums  

Rail Community


Autodesk Design & Make Report