How to get world coordinates (x,y,z) of entity

Hi,

Recently, i am searching on web to find a way to get real-time coordinates of a moving entity (like a car). I have found “transformation.origin” and “bounds.center” are good ways to represent the moving location of such entity/group. However, I found the coordinates of these commands are not equal to the query tool in utils (I use this tool as reference). And based on my tests, i find the query tool actually give me the right results. Still confuse why these commands just give me totally different values? Any comment is appreciate.

the Geom::Point3d you get from vertex.position are coordinates local to the parent (Model or ComponentDefinition). When you have an entity in nested instances you need to collect to combined transformations of all the parent instances to compute the world position.

Also note that all units in SU are stored in inches. Geom::Point3d return Length type for it’s xyz components. This type hold the model unit in inches, but it’s .to_s method will format the internal unit to model units for display to the end user.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.