how to get location of element?

prasannamurumkar
Advocate
Advocate

how to get location of element?

prasannamurumkar
Advocate
Advocate

Task is given in project their is floor plan containing rooms,wall etc.Having different sheets.

Able to locate the thermostat present or not ?

Now  wants to locate where it is present?

exact location?

How should get?

0 Likes
Reply
Accepted solutions (1)
8,132 Views
4 Replies
Replies (4)

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @prasannamurumkar ,

You can get location using element.Location

LocationPoint LP = element.Location as LocationPoint;
                string x = LP.Point.X.ToString();
                string y = LP.Point.Y.ToString();
                string z = LP.Point.Z.ToString();

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

prasannamurumkar
Advocate
Advocate

Thank you for reply do we  able to get in which room thermostat located.

For eg  Thermostat present   on wall of hall.

             Thermostat present   on wall of bedroom..

because just want to see thermostat  located correctly or not?

 

0 Likes

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @prasannamurumkar ,

Yes you can get the room name in which your Thermostat is located.

You need to use GetRoomAtPoint() 

 

 Element e;
                LocationPoint Lp = e.Location as LocationPoint;
                XYZ ElementPoint = Lp.Point as XYZ;
                Room R =doc.GetRoomAtPoint(ElementPoint);
                TaskDialog.Show("ROOM NAME", R.Name);

If this helped solve your problem  mark it as solutionSmiley Happy

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

prasannamurumkar
Advocate
Advocate

Thank you it is working.

0 Likes