multilistbox, scene objects

hi all im having trouble selecting objects with a multilistbox. ive manged to get the names of selected items as strings. what i want is the actual selected listbox objects to be added to an array. Any help would be great, a standard listbox is much easier lol

arr = cameras as array
listed = sort(for i in arr collect i.name)

rollout test "" width:162 height:243
(
multilistbox mylistbox "ListBox" pos:[19,25] width:122 height:9 items: listed

button del "del"
on del pressed do
(

--sets items names from bitarray to string array
selNames = for i in mylistbox.selection collect mylistbox.items[i]
print selNames
)
)

createdialog test

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
desigringo's picture

HI Miauu

Interesting script... can you please help me a little with the problem on following link...?
I have the script and max file there as well.

http://www.scriptspot.com/forums/3ds-max/general-scripting/string-array-...

miauu's picture

.

 
 
	rollout test "" width:162 height:243
	(
		local camArr = cameras as array
		local camNamesArr = for n in camArr collect n.name 
 
		multilistbox mylistbox "ListBox" pos:[19,25] width:122 height:9 items:camNamesArr
 
		button del "del"
 
		on del pressed do
		(
			selIdx = (mylistbox.selection as array)[1]
			--	"delete the object from the scene"
			delete camArr[selIdx]
			--	"deete the object from the array"
			deleteItem camArr selIdx
			--	"delete its name from the list"
			deleteItem camNamesArr selIdx
			--	"update the names in the list"
			mylistbox.items = camNamesArr
		)
	)
 
	createdialog test

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.