Toggle Wireframe
-
Hi guys,
Hopefully an easy one. I am trying to write a button to toggle between the face style of 'shaded with textures' (my default) and 'wireframe'.
I can't quite see why it can't be done with a simple if statement. My code is below
Any help would be appreciated.
Ross
` # Toggle Wireframe
def wireframe
if Sketchup.active_model.rendering_options["RenderMode"] = 0 # 2 = shaded, 0 = wireframe
Sketchup.active_model.rendering_options["RenderMode"] = 2
else
Sketchup.active_model.rendering_options["RenderMode"] = 0
endend`
-
The first thing I see is that your first if statement needs to have the double equal signs == instead of =
I don't know if the code is sound otherwise, but I'm sure that one thing might be ruining everything.
-
Good spot.
Thanks it is sorted now.
Ross
Advertisement