If.....then.......
how can i make it search the name in the selected objects instead of the entire scene?
the script searches the entire scene i want to search only the selected objects for G1.
thanks in advance.
on insert pressed do
(
objVar = $G1
(
if isvalidnode objVar then
(
Print "1"
)
else
(
Print "2"
)
)
)
Comments
objToFind = "ObjName" objVar
bga
Thanks but
Hi Thanks for the replay but its not working for me.
it keeps printing 2 if the object is selected or not. how can i have it print "1" if selected and if the name = G1 else print "2"
rollout test "Test"
(
listBox testList items:#("Item 1","Item 2")
button addToList "Add Item To End Of List" width:180
button insertToList "Insert Before Current Item" width:180
button removeFromList "Remove Current Item" width:180
on addToList pressed do
testList.items = append testList.items "test"
on insertToList pressed do
(
objToFind = "ObjName"
objVar = $G1
(
if isvalidnode objVar and objVar.children.count != 0 do
(
node = for o in objVar.children where o.name == objToFind collect o
if node.count != 0 then
(
Print "1"
)
else
(
Print "2"
)
)
)
)
on removeFromList pressed do
(
testList.items = deleteItem testList.items testList.selection
)
)
createDialog test 200 220
`
try those:
or this one:
(it also collect objects with specified name)
Great!!! thank you both!!!!
worked great.