here is some code for a very basic script that gets an objects bounding box
fn getBBounds theBB theObject = ( local c local myBB = theBB local theU ( c = snapshot theObject c.transform = matrix3 1 myBB = c.max - c.min theBB = myBB bb = theBB print theBB as string --b = box width:bb length:bb height:bb delete c ) ) Rollout TheMinMaxChecker "MinMaxChecker" ( button btnOK "Check it" checkbox chkAll "All" edittext txtValue width:200 height: 25 on btnOK pressed do ( bb = [0.0,0.0,0.0] getBBounds bb $ txtValue.text = bb as string ) ) createDialog TheMinMaxChecker width:250 height:150
This works which is great. However I thought it should have worked when it was this
fn getBBounds theBB theObject = ( local c ( c = snapshot theObject c.transform = matrix3 1 theBB = c.max - c.min delete c ) ) getBBounds bb $
I guess my question is, why do I have have to turn theBB into another variable to get it to work?