sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Toggle Wireframe

    Scheduled Pinned Locked Moved Plugins
    3 Posts 2 Posters 312 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      rossthompson
      last edited by

      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
      end

      end`

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        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.

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • R Offline
          rossthompson
          last edited by

          Good spot.

          Thanks it is sorted now.

          Ross

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement