-
mattoso 1 posts
hi
i know its close to christmas but im getting into MAXScript but dont know enough to get it to do what i want.
I want to script a louvre generator for creating slatted facades for 3d building models.
I have begun a script with boxes where the louvre slats will go but
- i want it so the number of floors to the building can be changed and each floor will have its own strip of facade but if you change the number of floors spinner more than once then it just creates new boxes (to be facades) over the top rather than instead of the existing.
ALSO when it comes to creating the slatted louvres (which would replace the boxes) i dont know what the best way to script it is, perhaps an array?
HERE IS THE SCRIPT SO FAR (i know its a mess)
--louvre generator
rollout ssRoll "louvre generator"
(
group "Basic"
(
spinner spn_facadeWidth "Facade Width " type:#float range: [1,100,50]
spinner spn_floorHeight "Floor Height " type:#float range: [1,100,3.2]
spinner spn_numFloors "Number of Floors " type:#integer range:[1,10,1]
button but_createFacade "Create Facade "
pickbutton pbt_pickFacade " Pick Facade " autodisplay:true
)
local facade
--events
on but_createFacade pressed do
(
facade = box()
facade.width = spn_facadeWidth.value
facade.length = 0.2
facade.height = spn_floorHeight.value
)
on spn_facadeWidth changed value do
(
facade.width = spn_facadeWidth.value
)
on spn_floorHeight changed value do
(
facade.height = spn_floorHeight.value
)
--push button not used yet
on pbt_pickFacade picked facade do
(
facade.width = spn_facadeWidth.value
facade.height = spn_floorHeight.value
)
--this loop doesnt seem right as it creates multiples if numFloors is changes 2+ times
on spn_numFloors changed value do
for i = 2 to spn_numFloors.value do
(
c = reference facade
move c [0,0,(i*spn_floorHeight.value)-spn_floorHeight.value]
)
)
createDialog ssRoll 200 150
ANY HELP WOULD BE VERY APPRECIATED
HAPPY CHRISTMAS TO ALL
boulery