Help - beginner

Hi guys
I need some help here.

I need a script that allow me create a rectangle, change the radius and end script.

I've tried this one, but it is not working.

Any help is welcome.

 
 
macroScript FirstScript category:"Eddie" 
 
(
 
 StartObjectCreation Rectangle 
 
original = selection[1]
select original
$.cornerRadius = 0.001
 
 
)
 
 <code>

Comments

Comment viewing options

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

...

Here we go

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "MakeRect"
( 
	spinner spn_Length "Length:    " pos:[6,5] fieldwidth:80 range:[0,1e9,30] type:#float
	spinner spn_Width "Width:      " pos:[5,25] fieldwidth:80 range:[0,1e9,30] type:#float
	spinner spn_Radius "C-Radius: " pos:[5,45] fieldwidth:80 range:[0,(1e9/2),0] type:#float
	button btn_Maker "Make Rectangle" pos:[4,65] width:143 height:20
	on spn_Radius changed val do (if val >= (newVal = (amin #(spn_Length.value,spn_Width.value))/2) do spn_Radius.value = newVal)
	on btn_Maker pressed do (Rectangle length:spn_Length.value width:spn_Width.value cornerRadius:spn_Radius.value pos:[0,0,0] isSelected:on)
)
createDialog bgaRoll 150 90 10 110 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

Comment viewing options

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