Jump to content

Recommended Posts

Posted

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)?

Posted

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")))

 

Posted
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?

 

 

 

Posted
4 minutes ago, mhupp said:

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.

Posted

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)
)

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...