Duplicate a box to different sizes using table data.
Hi!
Need to duplicate a box many times.
Each new box has different dimensions and associated name.
Each new box will be saved in new separate file.
This is a small sample of data that will be used (total table has 280 lines):
box name - legth - width - height
LB2043 - 5 - 2.5 - 2.5
SL2566 - 1.0625 - 1.0625 - 3.35
This code needs to run once for each box:
[CODE]
modPanel.setCurrentObject $.baseObject --entering sub object level
--set box dimensions
$.length = 6 -- how to get data from array in here???
$.width = 3 -- how to get data from array in here???
$.height = 6.2865 -- how to get data from array in here???
--center box in scene
$.pos = [-0,0,0.11938] --x,y,z
--save as a new file
sceneName = maxFilePath + "boxName" --how to put the "box name" here (example: LB2043) ???
saveMaxFile sceneName --save the file "boxName".max
[/CODE]
How can this code execute, each time with new "boxName" and "box dimensions"?
This is my first attempt at max script. Any advice is welcomed.
Thank you!
Comments
miauu, thanks for your help!
miauu, thanks for your help! It is a great feedback, and a chance to compare to my trial code.
Befor seeing your solution, I wrote this version:
.
Try this:
Tools and Scripts for Autodesk 3dsMax
Nice solution Miauu :)
Nice solution Miauu :)
.
Thank you. :)
Tools and Scripts for Autodesk 3dsMax