Tape Measure

This little python script for Vue finds the distance between two selected objects. To use it simply select to objects and run the script. A message will be displayed showing the distance between them in Vue’s own units.

  1. #******************************************************
  2. # Find the distance between two objects
  3. #
  4. # - VueTapeMeasure.py
  5. # - Finds the Distance between two objects
  6. # - By Mark Caldwell
  7. # - Version 0.1
  8. # - 3rd July 2007
  9. # - Copyright Mark Caldwell 2007
  10. # - Tested with Vue 6 Infinite
  11. #
  12. # How to use in 3 easy steps
  13. #
  14. # 1. Download this file onto your computer
  15. #
  16. # 2. Select 2 Objects
  17. #
  18. # 3. Then run script and wait for it to work
  19. # To run it go to Python -> Run Python Script
  20. # Then locate the file on your computer
  21. #
  22. #******************************************************
  23.  
  24. from math import sqrt
  25.  
  26. countobj=CountSelectedObjects()
  27.  
  28. if countobj>1:
  29. object=GetSelectedObjectByIndex(0)
  30. pos1=object.Position()
  31. object2=GetSelectedObjectByIndex(1)
  32. pos2=object2.Position()
  33. x=pos2[0]-pos1[0]
  34. y=pos2[1]-pos1[1]
  35. z=pos2[2]-pos1[2]
  36. d=sqrt(x*x+y*y+z*z)
  37.  
  38. Message ("Distance: "+str(d),"VueTapeMeasure")
  39.  
  40. #----------------------------------------------
  41. # End of Script
  42. #----------------------------------------------

impworks © Copyright Mark Caldwell 1996 - 2017