Jump to content

Recommended Posts

Posted

Does anyone know if there is a way to know what the position of an object snap is without actually clicking, say, to start a line or pick the center of a circle. The reason I ask is that I'm wondering if there is a way to verify that the picked point is actually the snap point (to detect near misses).

Posted

This is a bit vague. Why wouldn't the point your clicking on not be the point being snapped to? Or do you mean by the 'picked point' a point you intended to snap to rather than another one that is nearby?

Posted

ScribbleJ,

If the pickbox size is small (which might be necessary in a crowded field) and you wish, for example, to snap to an intersection, it may be difficult to tell if the point you pick actually snapped to the intersection without zooming in and checking. I'm thinking that, within a lisp routine, if I knew the position of the intersection (where the snap indicator is) before the pick, I could compare the pick point and verify that the positions coincide.

 

Lee,

Thanks for your reply. I'll have to look into your dgrid program to see how it applies to my question.

Posted

I'm trying to determine how Lee's dgrid applies as well.

 

Okay so...

 

If I understand what you described correctly it seems to me that your the snapped position might be your object snap tracking position. Is that correct? (I think this turned into a math word problem.) ;)

 

A lisp routine would need to obtain the variable of the 'snapped' position then give you feed back in order for you to check against what you know is the correct position. How would you know what the correct coordinates of that position is?

Posted

Maybe this will help you can change the snap mode as often as you like its the variable OSMODE just type it.

 

If you want only a centre arc or circle then (setvar "osmode" 4) in your code using multiple snaps can also be achieved end + mid + centre again just look at the osmode number.

 

A good idea is at start save the osmode value then at end put it back so user has snaps the same as when they started.

Posted
Lee,

Thanks for your reply. I'll have to look into your dgrid program to see how it applies to my question.

 

I'm trying to determine how Lee's dgrid applies as well.

 

Not so much how the 'DGrid' program applies, but I provided it as an example of how I have used the osnap function within that program to locate a snap point.

 

A simpler example to snap to an endpoint:

 

(defun c:test ( / pt )
   (if (setq pt (getpoint "\nPick Point: "))
       (progn
           (princ "\n  Original Point: ")
           (princ pt)
           (princ "\nSnap to Endpoint: ")
           (princ (osnap pt "_end"))
       )
   )
   (princ)
)

Posted

Lee,

Sorry I'm so dense. It took me awhile to see it. The osnap function does exactly what I need. Thanks very much.

Posted
Lee,

Sorry I'm so dense. It took me awhile to see it. The osnap function does exactly what I need. Thanks very much.

 

We all have those days (weather we admit it or not). I struggled with this one as well. Lee on the other-hand obviously understood it quite well. Its good to allow critical thinking to help us find flaws or weakness' in our thinking.

 

Falling down is not failure; refusing to get up is.

~Chinese proverb~

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