fajar
07-23-2009, 10:24 PM
Hey all it's me again whom tryng writte a script, I got some trouble here
here is the trouble
=====================================================================
(
try (destroyDialog Mapp) catch()
rollout Mapp "Mapping Tool"
(
spinner maplength "Scale: " pos:[-7,121] width:93 height:16 range:[0.001,150,5] type:#float heigth:20
button Aplly "Do It!" pos:[0,139] width:45 height:14 toolTip:"Apply Map Scaler to selected"
button edt "Edit" pos:[45,139] width:45 height:13
on Aplly pressed do
undo "Apply Map Scaler" on
(
for obj in selection do
(
if iskindof obj GeometryClass then
(
addModifier obj (MapScalerOSM ())
obj.MapScalerOSM.Scale = (maplength.value)
)
else if iskindof obj Shape then
(
addModifier obj (MapScalerOSM ())
obj.MapScalerOSM.Scale = (maplength.value)
)
Try (destroyDialog Scala1) catch()
rollout Scala1 ""
(
button btn1 "X" pos:[4,2] width:155 height:23
)
createDialog Scala1 162 28
)
)
)
createDialog Mapp 90 154
)
=====================================================================
when the button apply pressed everything is fine but it create repetitive create and destroy dialog over and over , the count is same as object in selection, how to prevent this happen? and display dialog just only one.
thank!
here is the trouble
=====================================================================
(
try (destroyDialog Mapp) catch()
rollout Mapp "Mapping Tool"
(
spinner maplength "Scale: " pos:[-7,121] width:93 height:16 range:[0.001,150,5] type:#float heigth:20
button Aplly "Do It!" pos:[0,139] width:45 height:14 toolTip:"Apply Map Scaler to selected"
button edt "Edit" pos:[45,139] width:45 height:13
on Aplly pressed do
undo "Apply Map Scaler" on
(
for obj in selection do
(
if iskindof obj GeometryClass then
(
addModifier obj (MapScalerOSM ())
obj.MapScalerOSM.Scale = (maplength.value)
)
else if iskindof obj Shape then
(
addModifier obj (MapScalerOSM ())
obj.MapScalerOSM.Scale = (maplength.value)
)
Try (destroyDialog Scala1) catch()
rollout Scala1 ""
(
button btn1 "X" pos:[4,2] width:155 height:23
)
createDialog Scala1 162 28
)
)
)
createDialog Mapp 90 154
)
=====================================================================
when the button apply pressed everything is fine but it create repetitive create and destroy dialog over and over , the count is same as object in selection, how to prevent this happen? and display dialog just only one.
thank!
