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

    Get mouse x,y,z location other an with an Inputpoint?

    Scheduled Pinned Locked Moved Developers' Forum
    20 Posts 6 Posters 1.1k 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.
    • thomthomT Offline
      thomthom
      last edited by

      Yea - Alt is Window' global hotkey to activate the menubar of the active window.

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

      1 Reply Last reply Reply Quote 0
      • KrisidiousK Offline
        Krisidious
        last edited by

        yes it is... but it also has the move on to extra plane and allow new faces to be created function. when I hit alt while querrying it hold the purple marker where ever I leave it and stays at a specific two coords. since one coord is already known I took it.

        alt-action-querry1.jpg

        alt-action-querry2.jpg

        By: Kristoff Rand
        Home DesignerUnique House Plans

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

          @krisidious said:

          yes it is... but it also has the move on to extra plane and allow new faces to be created function. when I hit alt while querrying it hold the purple marker where ever I leave it and stays at a specific two coords. since one coord is already known I took it.

          That is not a design by the tool - it's a side-effect from Windows sending the focus to the menubar. Don't think it behaves like this on OSX.

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

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

            It is a cool side effect, but it is not quite what I am looking for though anyhow. Because the query tool is still snapping to edges more than I wish it was. I'll just implement the InputPoint 3d position method, and wait until they hopefully fix the pickray for version8. Thank guys,

            Chris

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

            1 Reply Last reply Reply Quote 0
            • W Offline
              Whaat
              last edited by

              @thomthom said:

              But, yes, you can shoot a ray:

              ` ray = view.pickray(x, y)
              result = model.ray_test( ray )

              TODO: Recast on hidden entities`

              I have been using this method quite successfully but it does not work well if there is an 'out-of-context' face between the camera and the user's mouse position. This is even more of a problem if the user has 'Component Edit->Hide Rest of Model' The new raytest flag in SU8 that is supposed to ignore hidden geometry is not effective in this case. IMO it should also work for this situation.

              SketchUp Plugins for Professionals

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

                Could you test if the hit entity is in the current context, and just ignore it if it is not? That seems like it might be a solid workaround? Though I suppose that might be overkill because in many cases the user will not have 'Hide Rest of Model' turned on. So in those cases, you might want the user to be able to pick points outside the current context....hhmmmm.

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

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

                  @chris fullmer said:

                  I have not looked too much into this yet, but is there a way to get the 3d position of the cursor other than using an inputpoint? I was wondering if casting a ray would work. Does that return a point3d object? If I go that route, do I need to sort through what objects are or are not hidden/visible? Also, if it matters, I am only concerned about 3d points on a face. So if the mouse is hovering over nothing, I do not need to determine a 3d point for that. Just returning "nil" in that scenario is fine.

                  Chris,

                  I typically use a combination of InputPoint, to get the (x, y) in 2D and the face, and then view.Pickrayto intersect with the face and find the 3D point.

                  This is more or less what I have used in FreeHand On Surface, in particular to get rid of the inferences.

                  Fredo

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    @chris fullmer said:

                    ... Though I suppose that might be overkill because in many cases the user will not have 'Hide Rest of Model' turned on.

                    You can test that thru the RenderingOptions hash's InactiveHidden and InstanceHidden attributes.

                    <span class="syntaxdefault">if Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">rendering_options</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'InactiveHidden'</span><span class="syntaxkeyword">]<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># do it this way<br /></span><span class="syntaxkeyword">else<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># do it that way<br /></span><span class="syntaxdefault">end</span>
                    

                    I'm not here much anymore.

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

                      Well there you have it! Glad you can test if they have Hide Rest of Model on or off. I had my doubts about truly being able to come up with a flawless solution to get 3dpoints from the cursor while ignoring inferencing, but this thread seems to indicate that its possible. I'll have to re-write my app I was making while I started this thread, because it currently just ignores the mouseclick anytime it gets inferred onto an edge. Very good, my little plugin might finally be useful 😄

                      Chris

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

                      1 Reply Last reply Reply Quote 0
                      • Dan RathbunD Offline
                        Dan Rathbun
                        last edited by

                        @chris fullmer said:

                        Well there you have it! Glad you can test if they have Hide Rest of Model on or off.

                        Just be aware that Scene (Pages) can also have their own RendingOptions hash instance.

                        I'm not here much anymore.

                        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