View Single Post
Old 01-15-2008, 10:15 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
Here is a sample script that shows how to create an array of objects:
import viz

#Example code for creating arrays
balls = []
for x in range(10):
	#Create a ball and set its position
	ball = viz.add('ball.wrl')
	#Append ball object to array
#Example code for using arrays
print balls
print len(balls)
for b in balls:
	print b.getPosition()
When you add a file, Vizard will first check if the path exists relative to the script directory. If it does not exist, then it will look for the file in the resource path.
Reply With Quote