CALCAD Posted February 2, 2012 Posted February 2, 2012 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). Quote
Lee Mac Posted February 2, 2012 Posted February 2, 2012 osnap function. Example of usage: http://lee-mac.com/drawgrid.html Quote
ScribbleJ Posted February 2, 2012 Posted February 2, 2012 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? Quote
CALCAD Posted February 2, 2012 Author Posted February 2, 2012 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. Quote
ScribbleJ Posted February 3, 2012 Posted February 3, 2012 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? Quote
BIGAL Posted February 3, 2012 Posted February 3, 2012 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. Quote
Lee Mac Posted February 3, 2012 Posted February 3, 2012 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) ) Quote
CALCAD Posted February 3, 2012 Author Posted February 3, 2012 Lee, Sorry I'm so dense. It took me awhile to see it. The osnap function does exactly what I need. Thanks very much. Quote
ScribbleJ Posted February 3, 2012 Posted February 3, 2012 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~ 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.