PDA

View Full Version : select to get items,, using OR function


vishalk2000
08-19-2009, 04:32 PM
i have sphere01 and sphere02

for this i want to select object with name shpere01 if its not in the file, then the selection with script should do sphere02 if this is not present to it should get select for 3 and next 4,, like that 6 items,,, with same sequence numbered..


i wrote,,

select $Sphere01 or select $Sphere01

how to do this,, does i have get write if else statement,, for these,, if do..,, how??

SyncViewS
08-19-2009, 05:04 PM
(
-- create 6 Spheres
for i = 1 to 6 do
(
Sphere radius:5 pos[i*10, 0, 0]
)

-- select first available from Sphere01 to Sphere06
for i = 1 to 6 do
(
local oSphere = execute("$Sphere0" + (i as String))

if (isValidNode oSphere) do
(
select oSphere
exit
)
)
)
- Enrico

vishalk2000
08-20-2009, 04:58 AM
thank you very much SyncViewS,, your script works,, good,,. really i am happy to get good response from cgsociety website,, for learning and solving things with max scripting,,, ,,, all are very cooperative,,

CGTalk Moderation
08-20-2009, 04:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.