sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    VCB values disappear on orbit

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 332 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.
    • Chris FullmerC Offline
      Chris Fullmer
      last edited by

      So I'm writing a script that draws lines following a vector. All of it is working well until the part where I am now trying to integrate the VCB into my script. Here's the parts of the script that I think are messed up somehow. I could use some help, I'm guessing its a view and draw and invalidate problem (because I don't quite understand all that just yet).

      This is what gets run everytime the user enters a VCB value and hits enter:

      def onUserText(text, view)
      	@@last_height = text.to_l
      	endpoint_maker @faces
      	if (@last_line[0])
      		(@last_line[0]).erase!
      	end
      	make_line
      end # onUserText
      

      I also have a working draw method (I've canablized one of the example scripts, so they wrote it and it works great for it was written for which is updating the inputpoint on the screen (I think)):

      def draw(view)
      	Sketchup.set_status_text.draw view
          if( @ip.valid? && @ip.display? )
              @ip.draw view
              @displayed = true
          else
              @displayed = false
          end
      end
      

      So to re-iterate the problem: The VCB shows the values when the user types it. And it stays there. Until the model is orbited, then the value is not shown anymore.

      So....any thoughts? Thanks,

      Chris

      NOTE: I also included the entire tool class I've written just in case the problem is outside of the small bits I posted and someone would like to dig through the rest of the class. Thanks!


      normal line class.rb

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

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

        Come to think of it, here's the entire script as it stands so you can just install it (temporarily) and test it to see what I mean. This script is not intended to be a distributed release. So there's really no need to instll it unless you are helping troubleshoot the problem. Once the problem is solved, I'll post an update of the actual script, thanks.

        Chris


        clf_vertical_line_maker.rb

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

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

          So I had a breakthrough idea: just add the set status code to my draw method. So I've added the line:

          Sketchup.set_status_text @@last_height, SB_VCB_VALUE
          

          to the draw method. And it is always shown, but its being called non-stop (I think because I have an onMouseMove method that calls the draw method?). Is that really the way to do it?

          Chris

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

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            Chris, does the resume method get called after an Orbit? Maybe it can be used to reset the displayed values.

            def resume view
              Sketchup.set_status_text @@last_height, SB_VCB_VALUE
            end
            

            Hi

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

              Hey, that works great Jim, thanks! [me thinking this through out loud to make sure I have the logic straight] So the VCB is being set to blank because another tool is being called (oribt). Defining a resume method tells my tool what to do when it is resumed? Excellent. Thanks Jim,

              Chris

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

              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