[codesyntax lang=”python”]
#******************************************************
# Drops a group of selected objects one at a time
# starting with the lowest one and working up
#
# - progressivedrop.py
# - By Mark Caldwell
# - Version 0.1
# - 17th June 2006
# - Copyright Mark Caldwell 2006
# - Tested with Vue 5 Infinite 5.10 and Vue 6 Infinite Pre Release
#
# How to use in 3 easy steps
#
# 1. Download this file onto your computer
#
# 2. Select Objects to drop. Make sure they are not
# already resting on another object
#
# 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
#
#******************************************************
#----------------------------------------------
# Internal Variables Set Up: Don't alter these
#----------------------------------------------
posz=[]
height=[]
obj=[]
countobj=CountSelectedObjects()
#----------------------------------------------
# Find Selected Objects and Store Data
#----------------------------------------------
if countobj>0:
for i in range(0,countobj):
object=GetSelectedObjectByIndex(i)
coords=object.Position()
z=coords[2]
obj.append((z,object))
#----------------------------------------------
# Sort them based on each object's Z position
# Then reverse the order to get lowest first
#----------------------------------------------
obj.sort()
obj.reverse()
#----------------------------------------------
# Work through the objects one at a time
# dropping them
#----------------------------------------------
for i in range(0,countobj):
objx=obj.pop()
SelectOnly(objx[1])
Drop()
#----------------------------------------------
# Refresh Vue's Display
#----------------------------------------------
Refresh()
#----------------------------------------------
# End of Script
#----------------------------------------------
[/codesyntax]

