Redraw in viewport

Please help me how to make that script was interactive in viewport when values ​​are changed in the checkbox. Code create Bevel with radius at the polygon

rollout radius "BEVEL RADIUS"( 
 
spinner rad  "Radius "  type:#Float range:[0,1000,1.0] fieldWidth: 40 pos:[18,15]
spinner seg  "Segments "  type: #integer range:[0,1000,1] fieldWidth: 40 pos:[4,45]
checkbox ext "Extrude" checked:false pos:[115,15]
checkbox out "Outline" checked:false pos:[115,45]
groupbox gb5 "Bevel Type" width:100 height:70 pos:[180,5]
radiobuttons rbBevelType labels:#("Group", "Local Normal", "By Polygon") columns:1 pos:[190,20]
button but_radius "Create" pos:[120,80]
 
on but_radius pressed do undo on(
 
n=seg.value
r=rad.value
a=90/(n+1) as float
a0=a
!REG3XP1!>b0=0
c0=r
j=0
for i=1 to n+1 do
(
b=(r*sin a)-b0
b0=r*sin a
 
c=c0-(r*cos a)
c0=r*cos a
a=a+a0
 
 
$.bevelOutline = (if out.checked then 0-c else 0-b)
 
if ext.checked then $.bevelHeight = (if out.checked then 0+b else 0+c) 
else $.bevelHeight = (if out.checked then 0-b else 0-c)
 
 
case rbBevelType.state of
    
        (
            1: ($.bevelType = 0 )
            2: ($.bevelType = 1 )
            3: ($.bevelType = 2 )
        )
       
 
$.EditablePoly.buttonOp #Bevel
 
j=j+1
)
 
 
))
createDialog radius 290 110

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
TsveTan's picture

I don't see any problems

It works (MAX 2009).

AttachmentSize
untitled2.jpg 25.71 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.