Why does this simple utility script produce errors?

Hi, Im just starting out with maxscript. Can someone explain to me why this utility script produces errors when ran:

utility drawBox "Draw a Box :D"
(
newsox = box width:20 length:20 height:20
)

error:
-- Syntax error: at =, expected name
-- In line: newsox = b

any help i can get to understand this simple bit of code would be fantstic!!

Thanks

Comments

Comment viewing options

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

utility drawBox "Draw a Box

utility drawBox "Draw a Box :D"
(
	-- then close utility
	on drawBox close do
	(
		newsox = box width:20 length:20 height:20
	)
) -- ie need action to create a box

OR...

utility drawBox "Draw a Box :D"
(
	local newsox
	
	button myBtn "Create"
	
	on myBtn pressed do
	(
		newsox = box width:20 length:20 height:20
	)
)

my recent MAXScripts RSS (archive here)

Comment viewing options

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