RS: GetCursorPos additional arguments?


#1

Hi @dale,
Is it possible to have GetCursorPos return additional info of the OSnap point from the cursor (if it would normally snap to something).
Also, how about being able to Set cursor position from this method (or a new SetCursorPos one…)

thank you,

–jarek


(Dale Fugier) #2

Sorry, no. Rhino.GetCursorPos just calls the Windows GetCursorPos function. To know about osnaps and stuff, you would need to pick a point using Rhino.GetPoint.

As far as a SetCursorPos, sure its possible. Why would you want to do this?


#3

Hi Dale,

I was looking for a way to get the Snap point “real-time”. I am placing some objects interactively in a continuous loop using GetCursorPos + PointPick, but I see no way to use Rhino Osnaps with it. With GetPoint sure, I can do it but it’s not real-time anymore. Would there be any other doable way to report ‘what would I snap to’ at the cursor point?

As for SetCursorPos - for now I can have a poor-man’s snap (using meshes) - basically with PointPick I get the point on mesh and from there can get the mesh face and its vertices - if within given tolerance, I can ‘snap’ to them. But for what I am doing would be better if the cursor jumped there too.

I am probably trying to push it too much with RS but I am amazed of what already is possible with good old RhinoScript + resorting to some tricks.

thanks -

–jarek


#4

Hi @dale,

Another good reason for SetCursorPos - while using dynamic object placement @ cursor I need sometimes to do some changes/access popup menu etc. and keep the object in place. In that case I want to remember where the cursor is, do whatever is needed, and then move it back to the same point so the object does not change its place. In this sample video ( http://www.screencast.com/t/rHfxAGsC8 ) I’m using Command-like scale, and also by ZoomSelected on the placed object – currently setting back the cursor pos. with a workaround with AutoIt or DynamicWrapperX2 external modules but in the long run that will make it difficult to share the working script.

Also, if you had any new ideas how to respect snapping with GetCursorPos-like method, that would be very helpful as well.

thanks–

-jarek


(Dale Fugier) #5

I’ve added a wish list item for a new SetCursorPos method.

http://mcneel.myjetbrains.com/youtrack/issue/RH-32164

I have an idea on a GetCursorPos with snapping. Let me do some testing…


#6

Hi Dale,

Could we have an additional argument added to PointPick to ignore groups? (sort of Ctrl+Shift+LMB equivalent?).
Currently when objects are grouped there is no way to get only the ones under the cursor.

How is the snapping with GetCursorPos idea going ?

many thanks

Jarek


#7

Hi @Dale,

I see the https://mcneel.myjetbrains.com/youtrack/issueMobile/RH-32164 closed but can’t find a way to SetCursorPosition via RhinoScript. Can we still have that option added, maybe as optional parameter to GetCursorPos, or a new method ?

thanks,

–jarek


(Dale Fugier) #8

Sorry for my ignorance, but I still don’t see what setting the position of the Windows cursor is going get you. Perhaps you can clear up your expectation for me…

– Dale


#9

Hi Dale,

I thought this was a pretty good example:

but I will prepare more. There is a few more things apart from this one that open up a lot of possibilities for more interactive mouse/keyboard interactions with RhinoScript :slight_smile:

–jarek


(Dale Fugier) #10

There will be a new Rhino.SetCursorPos method, in RhinoScript, in next week’s WIP release.

– Dale


#11

Great, thank you :slight_smile:

– jarek