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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement