Help getting started with an array


#1

Hello, I am trying to init a multidimensional array
including an

  • object
  • the object’s bounding box minimums in min.z / min.x / min.y

beginner here.

global allPieces = $Piece* (objects i am interested in are prefixed “Piece”, this array inits fine)
global piecesArr = #() (the destination array)

for i = 1 to allPieces.count do(

local currentObj = allPieces[i]
local min_Z = allPieces[i].min.z
local min_X = allPieces[i].min.x
local min_Y = allPieces[i].min.y

piecesArr[i] = #(currentObj, min_Z, min_X, min_Y)
)


#2

from:
http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=files/GUID-A5B54C67-BFDD-45C0-9D6B-E6869817282A.htm,topicNumber=d30e171865

append <array> <value>

so:
append piecesArr #(currentObj, min_Z, min_Z, min_X, min_Y)


#3

Thank you! :gift: :balloon:


#4

take a look structures


#5

thanks for the ref! will need to use them custom structs soon.