vanowm Posted April 27, 2024 Posted April 27, 2024 I'm trying to determine if user moved mouse between two clicks. The problem I'm experiencing is that autocad moves cursor for you if it's inside a grip. So, if grips are shown and you select a point at a grip and then without moving cursor hide grips and select the same point, it will get point at a different location. Here is a demonstration: (DEFUN c:test (/ ent point dist gripsize) (SETQ gripsize (GETVAR "gripsize")) (SETVAR "gripsize" 25) (SETQ ent (CAR (ENTSEL))) (SSSETFIRST nil (SSADD ent)) (SETQ point (GETPOINT "\nPick a point on a grip and don't move mouse")) (SSSETFIRST nil) (SETQ dist (DISTANCE point (GETPOINT "\njust click again"))) (PRINC "\ncursor moved: ") (PRINC dist) (SETVAR "gripsize" gripsize) (PRINC) ) Any ideas how to determine if cursor moved or not in this particular case (as in grips are shown at first point and not shown at second point)? Quote
BIGAL Posted April 27, 2024 Posted April 27, 2024 Have you looked at GRREAD functions they return mouse position. May be what your looking for. I don't understand why not use osmode and set correct snaps between the 2 pick points, could do like END then a NON or CEN,MID,INT and so on. (SETQ dist (DISTANCE point (GETPOINT point "\njust click again"))) Quote
vanowm Posted April 28, 2024 Author Posted April 28, 2024 osmode has no effect on this issue. it's that stupidly-anoying-non-configurable-magnet-on-grips feature... (GRREAD T) seem to report actual cursor location, so it should do the trick. Thank you! Quote
mhupp Posted April 28, 2024 Posted April 28, 2024 1 hour ago, vanowm said: osmode has no effect on this issue. its a snap toggle. but why are you selecting the same point twice? Quote
vanowm Posted April 28, 2024 Author Posted April 28, 2024 4 minutes ago, mhupp said: its a snap toggle. It is not! Its grip related and the only way disable it is to disable grips all together. 6 minutes ago, mhupp said: but why are you selecting the same point twice? On first selection I'm selecting a grip, second selection determine if grip needs to be moved or removed if cursor hasn't moved. Quote
Steven P Posted April 28, 2024 Posted April 28, 2024 This: (defun c:tp ( / pt1 pt2 CP1 CP2) (setq pt1 (getpoint "Select Point")) ; Select a point (setq CP1 (cdr (grread 3))) ; Cursor Position (setq pt2 (getpoint "Select Point")) (setq CP2 (cdr (grread 3))) (princ "\n") (princ pt1) (princ " : ")(princ CP1) (princ "\n") (princ pt2) (princ " : ")(princ CP2) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.