PDA

View Full Version : MAXscript--need help


Ticonderoga
02-10-2003, 09:47 PM
I would like to ask how can convert a string into an object name?
e.g. "box01" -> $box01

I am asking this because I want to use MAXscript to import a text file (not a MAXscript file) to create a series of objects.
Thanks.

LFShade
02-11-2003, 03:01 AM
Look into the execute() function in the MAXScript help. That should give you some idea of how to proceed.

magicm
02-11-2003, 08:16 AM
Not sure if this is what you're looking for.. but if you have a string, say strObjectName, then you can do:

box name:strObjectName

googlo
02-11-2003, 02:29 PM
You can also programmatically select a node in Max without having to convert the name from string form by using the getNodeByName command followed by the name of the object/node in string form.

bkroll
02-11-2003, 03:34 PM
Yeah, the execute function is a handy one when you want to use strings to call or name objects. Here are some sample lines of code.

myBox = execute ("$" + "Box01")
select(execute ("$" + "Box01"))

Ticonderoga
02-12-2003, 09:19 PM
Thank you for everyone's help.

I asked this question for my crowd sim.
http://www.cgtalk.com/showthread.php?s=&threadid=43510

It turns out that using execute () do not speed out the import significantly; rather, it improves the stability of the import alot.

Many thanks. :)

CGTalk Moderation
01-14-2006, 09:00 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.