Autocad Draw Line From Midpoint

  1. #1

    Default Draw a line starting from the midpoint of itself

    Is there a way to draw a line by first picking it's midpoint? I'm trying to draw some lines that will have the same centerline, but I hate drawing a line, then moving it, draw line, move it, etc. This gets easily irritating with a lot of lines.

    If AutoCAD does it, and I just didn't know that'd be awesome, but I'm hoping someone has a LISP file that I can load up to do it. Thanks in advance for the help.


  2. #2

    Default Re: Draw a line starting from the midpoint of itself

    Can you give a better example of what you are trying to do?

    If you know the Midpoint then you already have the Endpoints. So why would you need to pick the Midpoint of the line first if the Endpoints are already known?


  3. #3

    Default Re: Draw a line starting from the midpoint of itself

    Okay, say you have a line that will be your centerline for a pipe. Well, when you draw the ends of the pipe, they'll be perpendicular, and bisected by said line, right? Well, to draw the end you could run the LINE command and then...

    ...select the endpoint of the centerline, draw half your needed distance, then go back and stretch, mirror, copy or paste the pipe-end line.

    ...use the FROM osnap, and draw the whole needed length. (honestly though, I have never really been able to get FROM to work properly for me since it uses coordinates).

    My idea is that this could be done without having to use an extra command. Sort of like how ARC lets you select the start point or center. I want to be able to select the start point or midpoint of a line from the get-go. Then half the entered length will go out from both ends of your selection point, so you get one line of the appropriate length, with it's midpoint already in its desired ending location.

    Does that make more sense?


  4. #4

    Default Re: Draw a line starting from the midpoint of itself

    Okay, that makes sense.
    There's no in-built tool but look up Tracking (tk) in Help for A20009. I think it was Temporary Tracking Points (tt) in earlier versions.

  5. #5

    Default Re: Draw a line starting from the midpoint of itself

    Well, 2 things. I don't have 2009, I have 2008. Sorry I should have specified. And I think you're refering to osnap tracking right? Well, that only works for specific points. Endpoint, midpoint, quadrant, etc. Use the tracking and you can start a certain distance form that point right? Well, let's change the imagined situation a bit. Let's pretend we don't have a centerline drawn, but we want things to line up as though there were one. We drafters area lazy bunch, and we don't want to have to erase the line later. But we're going to draw a section view of a cone from centerpoint to centerpoint. Make sense? We know that we're going to end up with a trapazoid shape at the end. Let's say, one end of the cone has a 1" dia. flat, and the other end has a 2" dia flat. the total length is 8". I want the midpoint of the 1" to be at origin.

    Now, what I want to do is to be able to type LINE; 0,0; [midpoint]; (move my mouse in the desired direction); 1, and get a line that goes out (let's say) vertically, 1/2" from origin in each direction. Is it just me, or doesn't that sound easier than having to mess with osnap tracking, or FROM, or MOVE, etc.? Then, you can osnap track 8" from the midpoint of this line; click; [midpoint]; 2, and now you've got both ends of the trapazoid.


  6. #6

    Default Re: Draw a line starting from the midpoint of itself

    Ok... I got ya...

    It's quick and dirty but I think it's what you're trying to do.

    Code:

    (defun C:TZOID (/ p1 dq p2 d2 ang p1o1 p1o2 p2o1 p2o2)   (setq p1 (getpoint "\nSpecify first point: ")           d1 (/ (getreal "\nWidth: ") 2)           p2 (getpoint "\nSpecify second point: ")           d2 (/ (getreal "\nWidth: ") 2)           ang (angle p1 p2)           p1o1 (polar p1 (- ang (/ pi 2)) d1)           p1o2 (polar p1 (+ ang (/ pi 2)) d1)           p2o1 (polar p2 (- ang (/ pi 2)) d2)           p2o2 (polar p2 (+ ang (/ pi 2)) d2)           )   (command ".line" p1o1 p1o2 p2o2 p2o1 "c")   (princ)	 )

  7. #7

    Default Re: Draw a line starting from the midpoint of itself

    Quote Originally Posted by Neo_Richard_Blake View Post

    Well, 2 things. I don't have 2009, I have 2008. Sorry I should have specified. And I think you're refering to osnap tracking right? Well, that only works for specific points. Endpoint, midpoint, quadrant, etc.

    No, it works from any specified (including picked) point.

    Quote Originally Posted by Neo_Richard_Blake View Post

    Use the tracking and you can start a certain distance form that point right? Well, let's change the imagined situation a bit. Let's pretend we don't have a centerline drawn, but we want things to line up as though there were one. We drafters area lazy bunch, and we don't want to have to erase the line later.

    You're speaking for yourself. I'm quite happy to erase construction geometry.

    Quote Originally Posted by Neo_Richard_Blake View Post

    But we're going to draw a section view of a cone from centerpoint to centerpoint. Make sense? We know that we're going to end up with a trapazoid shape at the end. Let's say, one end of the cone has a 1" dia. flat, and the other end has a 2" dia flat. the total length is 8". I want the midpoint of the 1" to be at origin.
    Now, what I want to do is to be able to type LINE; 0,0; [midpoint]; (move my mouse in the desired direction); 1, and get a line that goes out (let's say) vertically, 1/2" from origin in each direction. Is it just me, or doesn't that sound easier than having to mess with osnap tracking, or FROM, or MOVE, etc.? Then, you can osnap track 8" from the midpoint of this line; click; [midpoint]; 2, and now you've got both ends of the trapazoid.

    Yes, it sounds easy but the tool doesn't exist. and now you would have two lines 1/2" long and 8" apart so you would need another pick to set the length of the second line. Rather like making a tapered polyline.
    And it wouldn't be a trapezoid. (edit: okay, it would be trapezoidal)
    Last edited by jaberwok; 2008-11-26 at 01:15 PM.

  8. #8

    Default Re: Draw a line starting from the midpoint of itself

    Quote Originally Posted by Neo_Richard_Blake View Post

    Now, what I want to do is to be able to type LINE; 0,0; [midpoint]; (move my mouse in the desired direction); 1, and get a line that goes out (let's say) vertically, 1/2" from origin in each direction. Is it just me, or doesn't that sound easier than having to mess with osnap tracking, or FROM, or MOVE, etc.? Then, you can osnap track 8" from the midpoint of this line; click; [midpoint]; 2, and now you've got both ends of the trapazoid.

    I hope I undertsand what you are trying to do and may I suggest you simply draw a circle with the centre at the origin with a 1" diameter then draw a line from quadrant to quadrant.

  9. #9

    Default Re: Draw a line starting from the midpoint of itself

    Sean, I've moved this thread to the acad General forum as the Tips and Tricks forum is not for asking for a tip, but sharing one.

  10. #10

    Default Re: Draw a line starting from the midpoint of itself

    This should do exactly what you want:

    Code:

    ;;; Create line from its midpoint (defun c:LineM (/ pt1 pt2 pt0 ang len ed)     (while (setq pt1 (getpoint "\nPick midpoint of line: "))         (setq pt2 (getpoint pt1 "\nPick endpoint of line: "))         (setq ang (angle pt2 pt1)) ;Calculate reverse angle         (setq len (distance pt1 pt2)) ;Calculate half-length         (setq pt0 (polar pt1 ang len)) ;Calculate other endpoint         (setq ed (list '(0 . "LINE") (cons 10 pt0) (cons 11 pt2))) ;Create line's data         (entmake ed) ;Make the line     ) ;_ end of while     (princ) ) ;_ end of defun

oliverossaisent1980.blogspot.com

Source: https://forums.augi.com/showthread.php?91585-Draw-a-line-starting-from-the-midpoint-of-itself

0 Response to "Autocad Draw Line From Midpoint"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel