Notifications
Clear all

[Closed] ab. newbie question maxscript r3

I am a C++ programmer whos on his first go at maxscript on R3 (yeah ! old eh ?)
I have googled this problem and tried to understand but the examples are so complicated i’m not gettin’ the basics of it
all i’m trying to do …

for I = 1 to 10 collect
(
box length:10 width:10 height:10
)

x = 0
for b in boxes do
(
b.position = [x,0,0]
x = x + 10
)

simple enough eh ? … i get alert box
‘no “map” function for undefined’ and the last bracket is highlighted

TIA.

3 Replies

Where are you defining Boxes? I would assume its an array of the boxes created?

boxes = for I = 1 to 10 collect (box length:10 width:10 height:10)
x = 0
for b in boxes do
(
b.position = [x,0,0]
x += 10
)

The alternative method would be to set the positions while creating the boxes:

for i = 1 to 10 do
  box length:10 width:10 height:10 pos:[(i-1)*10,0,0]