Jump to content

Lisp CircleTangentsV1-0 - grread - simplifying snap to a point


Nikon

Recommended Posts

https://lee-mac.com/circletangents.html

These lines are from the code Lisp CircleTangentsV1-0  to snap to a point:

            ("endpoint"      " of " 00001)
            ("midpoint"      " of " 00002)
            ("center "        " of " 00004)
            ("node"          " of " 00008)
            ("quadrant"      " of " 00016)
             ..........................

 (grgetpoint "\nSpecify center of 2nd circle: This line of code requests the selection of the 2nd point.
To bind to the desired point, the user must type in the command line during the execution of the command, for example,
center (or c) - space, an entry appears on the command line: c of , now you need to enter 4 and only then will you be able to get a snap to the center.
I would like to simplify these steps. Is it possible in this case to use [.../.../...] to select a binding and not enter additional numbers?
Something like this:
 [Endpoint/Midpoint/Center/Node/Quadrant/Intersection/inSert/Perpendicular]

Edited by Nikon
Link to comment
Share on other sites

You can specify APERTURE and OSMODE system variables to desired value prior to running lisp, and GrSnap will recognize where you want to snap if your cursor is near desired snapping entity in range of previously set APERTURE variable...

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, marko_ribar said:

You can specify APERTURE and OSMODE system variables to desired value prior to running lisp, and GrSnap will recognize where you want to snap if your cursor is near desired snapping entity in range of previously set APERTURE variable...

If the APERTURE is 30 (I had 10), then the snap to the center of the circle is triggered. 
Thank you, this is a simple but effective solution.

Edited by Nikon
Link to comment
Share on other sites

@marko_ribar has given you a good answer using (setvar 'osmode x) you can reset the osnap in your code as required, you can also set combo's like end,center 5.

 

(setvar 'osmode 1)
(setq pt (getpoint "\nPick "))
(setvar 'osmode 4)
(setq cen (getpoint "\nPick circle "))

 

  • Thanks 1
Link to comment
Share on other sites

9 hours ago, BIGAL said:

@marko_ribar has given you a good answer using (setvar 'osmode x) you can reset the osnap in your code as required, you can also set combo's like end,center 5.

Thanks!

Interestingly, all bindings work except for the binding to the center of the circle (although this binding is enabled).
It can only be seen after installing APERTURE 30.

35.gif

 

36.gif

 

37.gif

Edited by Nikon
Link to comment
Share on other sites

Looking at your video you need to reset the osnap value if you want pick a circle only, the video shows perp and quad be looked for when it appears you only want center. Then aperture problem should go away but you do need to get near the circle object to find a center (setvar 'osmode 4). In some of my code I reset the osnaps multiple times and at the end reset to user defaults. I see it as a simple fix.

  • Thanks 1
Link to comment
Share on other sites

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