Jim Clayton Posted March 10, 2021 Posted March 10, 2021 What's up gang. I'm trying to track down a star command I could add in as custom that allows me to offset a line midway between two circles. I haven't had any luck tracking anything down so far. I was hoping that someone here might be able to help. I would appreciate the help. TKs. Quote
rkmcswain Posted March 10, 2021 Posted March 10, 2021 So you have a source line that could be anywhere, and you want to offset it (maintaining the angle) in between two circles, using the centerpoints? Start the Offset command Choose the Through method Select the line When it prompts for the through point, enter M2P Pick the center point of each circle. Line will offset to the midpoint between those to points, which is midway between the two circles... (Unless you mean midway between the outer edges of the two circles, instead of midway between their centers) Command: OFFSET Current settings: Erase source=No Layer=Source OFFSETGAPTYPE=0 Specify offset distance or [Through/Erase/Layer] <Through>: t Select object to offset or [Exit/Undo] <Exit>: Specify through point or [Exit/Multiple/Undo] <Exit>: m2p First point of mid: cen of Second point of mid: cen of Select object to offset or [Exit/Undo] <Exit>: Quote
Jim Clayton Posted March 10, 2021 Author Posted March 10, 2021 Thanks for the reply. I think my explanation lacked some detail. What I want to be able to do is offset a line midway between two center points of a circle by entering a command, selecting the AREA where the two circles are, and then the line will appear. Basically everything you're saying but an abbreviated version of that that uses a boundary box to select the area rather than selecting the individual center points. Hopefully that makes sense. And this function may already exist and I just don't know about it. I use m2p pretty regulary. I'm just trying to cut out a step because i have to repeat this function ALOT. Thanks for the help. Quote
rkmcswain Posted March 10, 2021 Posted March 10, 2021 That should be doable, but what if the selection the user makes includes less than, or more than 2 circles? Quote
Jim Clayton Posted March 10, 2021 Author Posted March 10, 2021 I should be the only one using this. And there's typically a fair amount of spacing between the two circles so no additional circles should be getting caught up in the mix unless i'm just being really sloppy. I would think the result would just be NIL if that were the case. But, i'm just brainstorming. TKs. Quote
pkenewell Posted March 10, 2021 Posted March 10, 2021 @Jim Clayton Something Like this? If I am understanding what you want, this is not too difficult to do: (defun C:MLC (/ p1 p2 mp ss) (princ "\nSelect ONLY (2) Circle Objects: ") (if (and (setq ss (ssget '((0 . "CIRCLE")))) (= (sslength ss) 2) ) (progn (setq p1 (cdr (assoc 10 (entget (ssname ss 0)))) p2 (cdr (assoc 10 (entget (ssname ss 1)))) mp (polar p1 (angle p1 p2) (/ (distance p1 p2) 2)) ) (command "._offset" "_T" pause "_non" mp "") ) (if ss (princ "\nSelection Set must be 2 Circle objects.")) ) (princ) ) 1 1 Quote
Jim Clayton Posted March 11, 2021 Author Posted March 11, 2021 This works perfect! I appreciate the help. Tks. 2 Quote
BIGAL Posted March 12, 2021 Posted March 12, 2021 Nice also Pkenewell as there is no image or dwg etc to check against another way to pick less demanding is to just pick 2 points inside circles then use SSGET "F" with circle filter. I have started using mapcar more for simple pt calcs. (setq mp (mapcar '* (mapcar '+ p1 p2) '(0.5 0.5 0.5))) 1 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.