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.

[codesyntax lang=”python”]

#******************************************************
# Find the distance between two objects
#
# - VueTapeMeasure.py
# - Finds the Distance between two objects
# - By Mark Caldwell
# - Version 0.1
# - 3rd July 2007
# - Copyright Mark Caldwell 2007
# - Tested with Vue 6 Infinite
#
# How to use in 3 easy steps
#
# 1. Download this file onto your computer
#
# 2. Select 2 Objects
#
# 3. Then run script and wait for it to work
#    To run it go to Python -> Run Python Script
#    Then locate the file on your computer
#
#******************************************************

from math import sqrt

countobj=CountSelectedObjects()

if countobj>1:
    object=GetSelectedObjectByIndex(0)
    pos1=object.Position()
    object2=GetSelectedObjectByIndex(1)
    pos2=object2.Position()
    x=pos2[0]-pos1[0]
    y=pos2[1]-pos1[1]
    z=pos2[2]-pos1[2]
    d=sqrt(x*x+y*y+z*z)

    Message ("Distance: "+str(d),"VueTapeMeasure")

#----------------------------------------------
# End of Script
#----------------------------------------------

[/codesyntax]

impworks © Copyright Mark Caldwell 1996 - 2024