Jump to content

Command To Offset Between Two Centerpoints


Recommended Posts

Posted

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.

Posted

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

 

Posted

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.

Posted

That should be doable, but what if the selection the user makes includes less than, or more than 2 circles?

Posted

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.

Posted

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

 

  • Like 1
  • Thanks 1
Posted

This works perfect! I appreciate the help.  Tks.

  • Like 2
Posted

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

 

  • Like 1

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