sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Clear the ruby window

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 6 Posters 451 Views 6 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.
    • F Offline
      fizgig
      last edited by

      Anyone know how to clear the text? I just hit enter a bunch of times but then those enters are put into my typing history that I have to skip over to get back to previous things I typed. Just want CLS or something like that.

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

        You can't do it from SketchUp/Ruby. You can do it on Windows using Win32API.so, let me recover cls.rb I have here...

        Hi

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

          You also need Win32API.so in your Plugins folder.


          cls.rb

          Hi

          1 Reply Last reply Reply Quote 0
          • F Offline
            fizgig
            last edited by

            Thanks! Works pretty well. Leaves a "1" in the corner but I can live with that. Appreciate it.

            1 Reply Last reply Reply Quote 0
            • N Offline
              NewOne
              last edited by

              Uh, looks a little strange for me what you've done there, Jim.
              If I don't ask to much, would you explain in detail, for dummies like myself ?

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

                Win32API allows you to call Windows API functions. I can't explain the syntax of the calls because I ripped them from SketchyPhysics. I think the "N" and "P" are defining the type (Integer, Pointer, etc) of argument the API function uses.

                Microsoft provides documentation for FindWindow and the the rest.

                ruby win32api

                Hi

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gruff
                  last edited by

                  @jim said:

                  Win32API allows you to call Windows API functions.

                  Win API functions are some of the fundemental behind the scenes functions used by Windows itself to manage the Windows GUI.

                  MS doesn't advertise them because many can be used to affect other peoples compiled programs. (In this case they are being used to manipulate the Ruby console.

                  They can be difficult to learn to use properly as how they interact with each other is not published in depth. One fairly good source is:
                  http://allapi.mentalis.org/apilist/f.shtml (Note the alphabetical list at the top of the web page.)

                  FindWindow is used to locate a top level window by ClassName and WindowTitle. It returns a pointer to the found window.

                  Windows pointers are created and destroyed constantly so you cannot save and reuse the value once you glom onto it.

                  FindWindowEx is used to find Child or Sibling Window handles.
                  Just about every Graphical object in Windows is a window. Textboxes, Listboxes Etc...

                  SendMessage is an all purpose tool used to manipulate a Window.
                  The kind of manipulation is defined by a list of MessageCode Constants.
                  0x000C is the SET TEXT message. There are many more.

                  The Win32API module that you are referencing in Ruby must remap some of the parameters as there appear to more than the functions normally take.
                  In this case I believe that 'N' stands for number which would be the window pointers and P stands for a String Pointer. (Course that is just a guess.)

                  Resistance is .... Character Forming. Grin

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

                    Gruf, I hope you stay around here for a long time.... πŸ˜„

                    Chris

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

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      Gruff
                      last edited by

                      This looks like a great group to hang around with. Looking forward to spending some time here.

                      RE: the Ruby console

                      I cannot believe that the good folks at Sketchup didn't provide a CLS command. Seems like a no brainer to me.

                      WinAPI's can get flakey.

                      Resistance is .... Character Forming. Grin

                      1 Reply Last reply Reply Quote 0
                      • fredo6F Offline
                        fredo6
                        last edited by

                        @gruff said:

                        This looks like a great group to hang around with. Looking forward to spending some time here.

                        RE: the Ruby console

                        I cannot believe that the good folks at Sketchup didn't provide a CLS command. Seems like a no brainer to me.

                        WinAPI's can get flakey.

                        Gruff,

                        If you are on Windows, why don't you install Jim's magnificent plugin Ruby Toolbar(obviously the plugin that I have been using the most, thanks Jim). It includes a Clear (on top of load, reload scripts).

                        Fredo

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

                          Anyone want to configure Jim's plugin for 64bit?

                          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