Color Class

Hello

Im trying to get all the boxes within my scene to be coloured the same but diffrently to all the other shapes in my scene

The code i have is:

try(destroydialog ::test_button)catch()
rollout test_button "TEST"
(
button findclass "Colour All Class Boxes"
on findclass pressed do
(
apropos "box" do for obj in objects do (obj.wirecolor = color (random 0 255) (random 0 255) (random 0 255))
)
)
createDialog test_button 160 100

Keeps coming up with errors

Thanks

Comments

Comment viewing options

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

...

try(destroydialog ::test_button)catch()
rollout test_button "TEST"
(
	button findclass "Colour All Class Boxes"
	on findclass pressed do
	(
		for b in geometry where isKindOf b Box do b.wirecolor = random black white
	)
)
createDialog test_button 160 100

bga

Comment viewing options

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