[Closed] maxscript and AEC Ext. Wall
Hello world,
I’ve modeled a floor plan using the AEC wall object but now all wall need to be few units higher and considering it are 200+ pieces of wall i thought it would be great to select all and use a maxscript for it.
because i never touched maxscript before i did some reading and with some examples/tutorial ‘I’ made a script that works for all objects, with a height parameter, except for my wall objects it doesnt give a error when i press my button but nothing happens to my object(s).
what am i doing wrong here?
Thx
rollout myRollout "Wall Rollout" width:168 height:232
(
button btn1 "change height now!" pos:[16,95] width:135 height:38
spinner spn3 "" pos:[38,28] width:68 height:16 type:#worldunits
on btn1 pressed do
(
print $
print spn3.value
for obj in selection do
(
try
(
(
$.height = spn3.value
)
)
catch()
)
)
)
myFloater = newrolloutfloater "Wall changer" 300 400
addrollout myRollout myFloater
The only problem that i see is here
$.height = spn3.value
This statement will work on the first selected item. you are running the for loop correctly to iterate over all the selected items but are not using the variable (obj) that points to the current item.
Change the $ with obj like this
obj.height = spn3.value
Hope this helps
Mobeen
thank you! for pointing me toward that error. the iterate works on boxes or any primitive who got an height parameter but it still doesnt work on the AEC wall objects. it doesn’t give an error orso just nothing happends.
the documentation says it got an height parameter
<Wall>.height Float default: 96.0 – float
could it be a bug? im not sure if my script just doesnt apply to the walls or if it should work in theory. im using max7 SP1
regards
Hello there,
Just make sure that the property you are looking for is read/write. Moreover see if there are any set* functions for the AEC object in the docs.
Thanx
mobeen
the documention doesn’t say much about that, but it doesn’t say anywhere its a set function so maybe that’s the case.
darn guess im going to spend some nights selecting walls and changing its height manually.
maybe if you got the time can you try to get it working I would be sooo thankful
Thank for help so far
im at the point of nothing else to try but do it manual.
can some please please give it an try, ive to do so many wall
or maybe has an other suggestion doing it faster