sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Crazy problem with Right Click

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    53 Posts 14 Posters 11.5k Views 14 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.
    • J Offline
      jpalm32
      last edited by

      As a side note: My wife does large legal docs in Word and says she has a problem when she uses right click often, needs to save and reload doc.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        At work I've been forced to diable most of my plugins - as that improve the situation. But the folder fill up as I need to re-add plugins as I need them.

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • L Offline
          lapx
          last edited by

          This and the nomadic toolbar is amateur and should be fixed immediately 😑
          While im on my horse there needs to be better transition form cad circles to sketchup!
          What are these guy's at google doing all this time, playing ping pong!

          1 Reply Last reply Reply Quote 0
          • soloS Offline
            solo
            last edited by

            @unknownuser said:

            What are these guy's at google doing all this time, playing ping pong!

            Planning base camp 2011 Hawaii maybe? πŸ’š

            http://www.solos-art.com

            If you see a toilet in your dreams do not use it.

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

              The problem is Ruby scripts are calling-
              UI::Command.new
              and not attaching the new command to a menu item.

              If you want to verify this run-

              for i in 0..1000 do
              cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
              end

              I can see Ruby scripts creating new commands on each right mouse click.
              Every new command creates a unique command ID in SU and there are only 1000
              command IDs available. Normally a command is attached to a menu and when
              the menu goes away the IDs are recycled, but since these commands are not
              attached to a menu, they don't get recycled.
              I'm going to try and figure out how to dump the list of commands (they have
              menu item text) so that people can see who's causing the problem.

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                Ah! This is great news! πŸ‘ πŸ‘

                The Mighty Bug Hunt of 2010 is now officially open!

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @jhauswirth said:

                  I'm going to try and figure out how to dump the list of commands (they have
                  menu item text) so that people can see who's causing the problem.

                  ObjectSpace.each_object(UI::Command) {|x| p x }
                  Gives you access to each UI::Command object. But the class has only setter methods defined. And instance_variables on an instance of UI::Command returns empty.

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    @jhauswirth said:

                    Normally a command is attached to a menu and when
                    the menu goes away the IDs are recycled, but since these commands are not
                    attached to a menu, they don't get recycled.

                    What is the command is used in both menus and toolbars? or just toolbars?
                    I often create an instance of a Command when both a menu and a toolbar is executing the same command.

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

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

                      [quote="thomthom":287u3y55]
                      @jhauswirth said:

                      I'm going to try and figure out how to dump the list of commands (they have
                      menu item text) so that people can see who's causing the problem.

                      ObjectSpace.each_object(UI::Command) {|x| p x }
                      Gives you access to each UI::Command object. But the class has only setter methods defined. And instance_variables on an instance of UI::Command

                      Yeh! What ThomThom said.
                      Really! You guys scare me sometimes.

                      1 Reply Last reply Reply Quote 0
                      • jeff hammondJ Offline
                        jeff hammond
                        last edited by

                        interesting turn of events..
                        i've read a lot of these right-click posts and thought they were something to do with windows because i've never experienced the problem or heard of another mac user with the problem.
                        sounds like it should affect mac users as well then.. maybe none of the mac users here have the trouble ruby installed?
                        must be one of those windows specific exporters or something?

                        [edit] hmm.. well, except for the fact that it's been reproducible without using plugins at all ❓

                        dotdotdot

                        1 Reply Last reply Reply Quote 0
                        • thomthomT Offline
                          thomthom
                          last edited by

                          @unknownuser said:

                          [edit] hmm.. well, except for the fact that it's been reproducible without using plugins at all ❓

                          By right clicking repeatedly on geometry without cancelling the menu. But the menus then usually returns ones you cancel it.

                          Thomas Thomassen β€” SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 Reply Last reply Reply Quote 0
                          • jeff hammondJ Offline
                            jeff hammond
                            last edited by

                            @thomthom said:

                            @unknownuser said:

                            [edit] hmm.. well, except for the fact that it's been reproducible without using plugins at all ❓

                            By right clicking repeatedly on geometry without cancelling the menu. But the menus then usually returns ones you cancel it.

                            i shit you not, i just tried rightclicking on a square at least 800 times πŸ’š .. no glitches

                            dotdotdot

                            1 Reply Last reply Reply Quote 0
                            • thomthomT Offline
                              thomthom
                              last edited by

                              @unknownuser said:

                              i shit you not, i just tried rightclicking on a square at least 800 times πŸ’š .. no glitches

                              Did you right click
                              and then while the menu was still open right click again?
                              (on the same entity)

                              Thomas Thomassen β€” SketchUp Monkey & Coding addict
                              List of my plugins and link to the CookieWare fund

                              1 Reply Last reply Reply Quote 0
                              • thomthomT Offline
                                thomthom
                                last edited by

                                Here's a little hack I made. It intercepts all the setter methods and prints the arguments to the console. Named "_0.rb" to make it load first. (or does underscore make it load last...?)

                                For some reason it is not overriding the initialize method.

                                But I do intercept the setter methods. On my home machine I get some output every time I right click:
                                tooltip: Scaling with orientation of scaling box tooltip: Tapering with orientation of scaling box tooltip: Planar Shearing with orientation of scaling box tooltip: Planar Shearing by selection of plane and angle tooltip: Stretching with orientation of scaling box tooltip: Twisting with orientation of scaling box tooltip: Rotation with orientation of scaling box tooltip: Rotation by selection of plane and angle tooltip: Radial Bending by selection of plane and angle tooltip: Make Groups and Components Unique

                                And when I do this line for every right click:
                                c=[]; ObjectSpace.each_object(UI::Command) {|x| c << x }
                                the count goes up by 10 - one for each tooptip.

                                So in my case, even though I'm not catching the new method, it does appear that I've accounted for every leak. There might be other plugins that does not set any other methods when it creates a new Command object, so I'm not sure how to catch that since I can't hook into initialize.

                                As for the tooltips, they are from FredoScale, right?


                                _0.rb

                                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

                                1 Reply Last reply Reply Quote 0
                                • jeff hammondJ Offline
                                  jeff hammond
                                  last edited by

                                  yes..

                                  drew a rectangle then started right-clicking repeatedly on its face.. (didn't do anything else other than those two steps.. no left-clicking,selecting, or moving the mouse pointer etc.)

                                  dotdotdot

                                  1 Reply Last reply Reply Quote 0
                                  • thomthomT Offline
                                    thomthom
                                    last edited by

                                    @unknownuser said:

                                    yes..

                                    drew a rectangle then started right-clicking repeatedly on its face.. (didn't do anything else other than those two steps.. no left-clicking,selecting, or moving the mouse pointer)

                                    You must be charmed.

                                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                    List of my plugins and link to the CookieWare fund

                                    1 Reply Last reply Reply Quote 0
                                    • jeff hammondJ Offline
                                      jeff hammond
                                      last edited by

                                      @thomthom said:

                                      You must be charmed.

                                      ha..
                                      but like i said earlier, i've never seen a mac user state this problem.. maybe this is one area where windows and osx are different with SU?

                                      dotdotdot

                                      1 Reply Last reply Reply Quote 0
                                      • thomthomT Offline
                                        thomthom
                                        last edited by

                                        Ah, you're on an apple. So you said. And so it says in your profile.
                                        It's late. G'night! πŸ˜‰

                                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                        List of my plugins and link to the CookieWare fund

                                        1 Reply Last reply Reply Quote 0
                                        • EarthMoverE Offline
                                          EarthMover
                                          last edited by

                                          I've been able to reproduce my right click issues with consistency. I've narrowed down the problem to exploding groups and it seems to occur when I use my keyboard shortcut specifically.

                                          If someone could try and reproduce my results -

                                          1. Open new sketchup
                                          2. Make a Box
                                          3. Use keyboard shortcut to make the box a group
                                          4. Use keyboard shortcut to explode box
                                          5. Repeat step 3 & 4 - 15 times
                                          6. Check the right click menu during 5 more group & explodes

                                          I've tested the above 5 times in new SU sessions and everytime I get the same results. Right click menu goes gray between 15-20 group & explodes via keyboard shortcut.

                                          Interestingly I also tested doing 20 right click group and explodes and the menu didn't gray out, however after doing just one group and explode with the keyboard shortcut, my menu immediately went gray.

                                          Test with Shortcuts - http://www.screencast.com/t/MTVkNDBi
                                          Test with Right click Group & Explode - http://www.screencast.com/t/ZDFiMDRmM

                                          3D Artist at Clearstory 3D Imaging
                                          Guide Tool at Winning With Sketchup
                                          Content Creator at Skapeup

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

                                            @jhauswirth said:

                                            The problem is Ruby scripts are calling-
                                            UI::Command.new
                                            and not attaching the new command to a menu item.

                                            Correct, we are not typically attaching Commands to menus because Menu.add_item will accept a block of code as well as a Command. So unless a Toolbar is also being created, it is typical to just pass the name of a method to Menu.add_item:

                                            def method_name
                                              # do sometrhing
                                            end
                                            menu = UI.menu.add_item("Menu Text") { method_name }
                                            

                                            When a Toolbar is being used, we are required to create a Command becuase Toolbar.add_item only accepts a Command. So when there is a Toolbar already being used, it is easy to add the same Command to a menu since it is already created.

                                            I think it is also not typical to create a new Command when adding a context menu. Are we sure SketchUp (Ruby) is not promoting code blocks into Commands? (Is that even possible? πŸ˜• )

                                            Hi

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

                                            Advertisement