<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Draw a line from its midpoint in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318287#M154967</link>
    <description>&lt;P&gt;I tried both regeneration commands and it didn't fix it. But I still admit it's probably my graphic's card - it's on my work computer, and I've had problems with it ever since they bought it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-13 163917.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1466716iF670AFC67B8D0A70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-02-13 163917.png" alt="Screenshot 2025-02-13 163917.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-13 164924.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1466717i748F0074EDE42C8E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-02-13 164924.png" alt="Screenshot 2025-02-13 164924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Should I make this into a separate post somewhere? Not trying to spam everyone.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2025 21:55:01 GMT</pubDate>
    <dc:creator>ryanYF2FK</dc:creator>
    <dc:date>2025-02-13T21:55:01Z</dc:date>
    <item>
      <title>Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501087#M154956</link>
      <description>&lt;P&gt;Hi, this is kind of hard to explain, but is there a way to draw a line starting at its midpoint? Like if I want to draw a 10 inch line i pick a point and it extends out in both directions 5 inches. Kind of like how you draw a circle. Sorry if this is a stupid question, or if it is super simple or easy to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to read this, and any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 17:56:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501087#M154956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-04T17:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501094#M154957</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you might use a block as replacement for a line. The block can contain a line from -1,0 to +1,0 ... when you then insert the block you can show rotation and scalefactor and the result would be a (visual) line which has it's midpoint where you showed the insertion point of the block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would not know a function that can do that in AutoCAD.&lt;/P&gt;
&lt;P&gt;Alterative could be to use commands _LENGTHEN or _SCALE, but then the line has already to exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:00:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501094#M154957</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2019-01-04T18:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501113#M154958</link>
      <description>&lt;P&gt;Use an xline and trim.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:08:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501113#M154958</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2019-01-04T18:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501130#M154959</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no in-the-box way to do this.&amp;nbsp; You could construct a dynamic block that inserts at the middle and then allows you to stretch the line. Or, perhaps a visit to the &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130" target="_blank"&gt;customization forum&lt;/A&gt; will get you a lisp routine that does this for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;Please select the &lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt; button if my post solves your issue or answers your question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:18:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501130#M154959</guid>
      <dc:creator>john.vellek</dc:creator>
      <dc:date>2019-01-04T18:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501193#M154960</link>
      <description>&lt;P&gt;If you don't mind not seeing both ends stretch, but you're open to drawing half of it and then having it "finished" to full length [in simplest terms]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun C:LineMid ()
  (command
    "_.LINE" pause pause ""
    "_.scale" "_last" "" "@" 2
  ); command
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;Prompts could be added where those pauses are, to make it clear what you're going to get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see it "drag" at both ends as you draw it, a routine using (grread) and (grdraw) shouldn't be hard to work out.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:48:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501193#M154960</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-01-04T18:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501301#M154961</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see it "drag" at both ends as you draw it, a routine using (grread) and (grdraw) shouldn't be hard to work out.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Such as this quickie:&lt;/P&gt;
&lt;PRE&gt;;;  LineMidPoint.lsp [command name: LMP]
;;  To draw a Line starting from its midpoint, rather than from end
;;    to end as in AutoCAD's LINE command.
;;  Drags shape of resulting Line as cursor is moved.
;;  Kent Cooper, 4 January 2019
(defun C:LMP ; = Line from MidPoint
  (/ mid cur cor1 cor3 delta bulge cor2 cor4 prelist vertices rect)
  (setq mid (getpoint "\nMidpoint of Line: "))
  (prompt "\nOne end of Line: ")
  (while
    (and mid (setq cur (grread T 12 0)))
    (cond
      ((= (car cur) 5); moved cursor - draw vector
        (grdraw
          (cadr cur)
          (polar mid (angle (cadr cur) mid) (distance (cadr cur) mid))
          -1 1 ; contrast color to background, highlight
        ); grdraw
      ); moved-cursor condition
      ((= (car cur) 3); picked point - draw Line, end (while) loop
        (entmake
          (list
            '(0 . "LINE")
            (cons 10 (cadr cur))
            (cons 11 (polar mid (angle (cadr cur) mid) (distance (cadr cur) mid)))
          ); list
        ); entmake
        (setq mid nil); end (while) loop
      ); picked-point condition
    ); cond - grread possibilities
  ); while
  (princ)
); defun - LMP
(prompt "\nType LMP to draw a Line starting at its MidPoint.")&lt;/PRE&gt;
&lt;P&gt;Unfortunately, it doesn't honor Osnap for picking the one endpoint [though it does for the midpoint].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 19:39:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/8501301#M154961</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-01-04T19:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/11160009#M154962</link>
      <description>&lt;P&gt;Another very basic tool every other CAD software has that AUTOCAD doesnt...&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 17:39:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/11160009#M154962</guid>
      <dc:creator>CRGDesign</dc:creator>
      <dc:date>2022-05-10T17:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13317659#M154963</link>
      <description>&lt;P&gt;I was getting graphical glitches when I tried&amp;nbsp;Kent Cooper's. It may be an issue of what versions we're using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I made up my own. Activate with "LMID".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: I started getting odd errors, and found that there are several situations that break what I made. I'm pulling this down until I can figure out the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 18:06:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13317659#M154963</guid>
      <dc:creator>ryanYF2FK</dc:creator>
      <dc:date>2025-02-13T18:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13317872#M154964</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11582760"&gt;@ryanYF2FK&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I was getting graphical glitches when I tried&amp;nbsp;Kent Cooper's. ...&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;[Which one?&amp;nbsp; What kinds of issues?]&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 18:16:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13317872#M154964</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2025-02-13T18:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318020#M154965</link>
      <description>&lt;P&gt;With LMP, I was getting ghosted images like in this photo.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ryanYF2FK_0-1739473911382.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1466679i7B588CF6C6E69027/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ryanYF2FK_0-1739473911382.png" alt="ryanYF2FK_0-1739473911382.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one you shared (LineMid) seems to work great! I completely missed it when I was reading through the comments originally. Now if I fix mine, it'll only be for the practice haha&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 19:17:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318020#M154965</guid>
      <dc:creator>ryanYF2FK</dc:creator>
      <dc:date>2025-02-13T19:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318205#M154966</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11582760"&gt;@ryanYF2FK&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;With LMP, I was getting ghosted images like in this photo.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I bet a REGEN or REGENALL command fixes that, doesn't it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your video card choked, nothing more: share with us screenshots of your AutoCAD's ABOUT and GRAPHICSCONFIG command pop-ups please.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 21:08:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318205#M154966</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2025-02-13T21:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318287#M154967</link>
      <description>&lt;P&gt;I tried both regeneration commands and it didn't fix it. But I still admit it's probably my graphic's card - it's on my work computer, and I've had problems with it ever since they bought it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-13 163917.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1466716iF670AFC67B8D0A70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-02-13 163917.png" alt="Screenshot 2025-02-13 163917.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-13 164924.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1466717i748F0074EDE42C8E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-02-13 164924.png" alt="Screenshot 2025-02-13 164924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Should I make this into a separate post somewhere? Not trying to spam everyone.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 21:55:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318287#M154967</guid>
      <dc:creator>ryanYF2FK</dc:creator>
      <dc:date>2025-02-13T21:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318315#M154968</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;regardless of the problem here:&lt;/P&gt;&lt;P&gt;You have installed "less important" updates for Architecture, but not a single update for AutoCAD?&lt;/P&gt;&lt;P&gt;AutoCAD Productversion, current is 2025.1.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/ARCHDESK/2025/ENU/?guid=AUTOCAD_2025_UPDATES" target="_blank" rel="noopener"&gt;[F1] https://help.autodesk.com/view/ARCHDESK/2025/ENU/?guid=AUTOCAD_2025_UPDATES&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 22:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13318315#M154968</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2025-02-13T22:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13319397#M154969</link>
      <description>&lt;P&gt;Good catch, thanks. I've got that fixed now.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 12:50:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/13319397#M154969</guid>
      <dc:creator>ryanYF2FK</dc:creator>
      <dc:date>2025-02-14T12:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a line from its midpoint</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/14095035#M362817</link>
      <description>&lt;P&gt;A useful tool. Extended now with osnaps (LeeMac's), center glyph and fixed-distance option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;;;  LineMidPoint.lsp [command name: LMP]
;;  To draw a Line starting from its midpoint, rather than from end
;;    to end as in AutoCAD's LINE command.
;;  Drags shape of resulting Line as cursor is moved.
;;  Kent Cooper, 4 January 2019
;;
;;  Osnaps, Dist, Center glyph - V.Michl, www.cadforum.cz, 4/2026

(defun C:LMP ; = Line from MidPoint
  (/ mid cur cor1 cor3 delta bulge cor2 cor4 prelist vertices rect osf ospt vs mode distf)


;; Object Snap for grread: Snap Function  -  Lee Mac
;; Returns: [fun] A function requiring two arguments:
;; p - [lst] UCS Point to be snapped
;; o - [int] Object Snap bit code
;; The returned function returns either the snapped point (displaying an appropriate snap symbol)
;; or the supplied point if the snap failed for the given Object Snap bit code.

(defun LM:grsnap:snapfunction ( )
    (eval
        (list 'lambda '( p o / q )
            (list 'if '(zerop (logand 16384 o))
                (list 'if
                   '(setq q
                        (cdar
                            (vl-sort
                                (vl-remove-if 'null
                                    (mapcar
                                        (function
                                            (lambda ( a / b )
                                                (if (and (= (car a) (logand (car a) o)) (setq b (osnap p (cdr a))))
                                                    (list (distance p b) b (car a))
                                                )
                                            )
                                        )
                                       '(
                                            (0001 . "_end")
                                            (0002 . "_mid")
                                            (0004 . "_cen")
                                            (0008 . "_nod")
                                            (0016 . "_qua")
                                            (0032 . "_int")
                                            (0064 . "_ins")
                                            (0128 . "_per")
                                            (0256 . "_tan")
                                            (0512 . "_nea")
                                            (2048 . "_app")
                                            (8192 . "_par")
                                        )
                                    )
                                )
                               '(lambda ( a b ) (&amp;lt; (car a) (car b)))
                            )
                        )
                    )
                    (list 'LM:grsnap:displaysnap '(car q)
                        (list 'cdr
                            (list 'assoc '(cadr q)
                                (list 'quote
                                    (LM:grsnap:snapsymbols
                                        (atoi (cond ((getenv "AutoSnapSize")) ("5")))
                                    )
                                )
                            )
                        )
                        (LM:OLE-&amp;gt;ACI
                            (if (= 1 (getvar 'cvport))
                                (atoi (cond ((getenv "Layout AutoSnap Color")) ("117761")))
                                (atoi (cond ((getenv  "Model AutoSnap Color")) ("104193")))
                            )
                        )
                    )
                )
            )
           '(cond ((car q)) (p))
        )
    )
)

;; Object Snap for grread: Display Snap  -  Lee Mac
;; pnt - [lst] UCS point at which to display the symbol
;; lst - [lst] grvecs vector list
;; col - [int] ACI colour for displayed symbol
;; Returns nil

(defun LM:grsnap:displaysnap ( pnt lst col / scl )
    (setq scl (/ (getvar 'viewsize) (cadr (getvar 'screensize)))
          pnt (trans pnt 1 2)
    )
    (grvecs (cons col lst)
        (list
            (list scl 0.0 0.0 (car  pnt))
            (list 0.0 scl 0.0 (cadr pnt))
            (list 0.0 0.0 scl 0.0)
           '(0.0 0.0 0.0 1.0)
        )
    )
)

;; Object Snap for grread: Snap Symbols  -  Lee Mac
;; p - [int] Size of snap symbol in pixels
;; Returns: [lst] List of vector lists describing each Object Snap symbol

(defun LM:grsnap:snapsymbols ( p / -p -q -r a c i l q r )
    (setq -p (- p) q (1+  p)
          -q (- q) r (+ 2 p)
          -r (- r) i (/ pi 6.0)
           a 0.0
    )
    (repeat 12
        (setq l (cons (list (* r (cos a)) (* r (sin a))) l)
              a (- a i)
        )
    )
    (setq c (apply 'append (mapcar 'list (cons (last l) l) l)))
    (list
        (list 1
            (list -p -p) (list p -p) (list p -p) (list p p) (list p p) (list -p p) (list -p p) (list -p -p)
            (list -q -q) (list q -q) (list q -q) (list q q) (list q q) (list -q q) (list -q q) (list -q -q)
        )
        (list 2
            (list -r -q) (list 0  r) (list 0  r) (list r -q)
            (list -p -p) (list p -p) (list p -p) (list 0  p) (list 0  p) (list -p -p)
            (list -q -q) (list q -q) (list q -q) (list 0  q) (list 0  q) (list -q -q)
        )
        (cons 4 c)
        (vl-list* 8 (list -r -r) (list r r) (list r -r) (list -r r) c)
        (list 16
            (list p 0) (list 0 p) (list 0 p) (list -p 0) (list -p 0) (list 0 -p) (list 0 -p) (list p 0)
            (list q 0) (list 0 q) (list 0 q) (list -q 0) (list -q 0) (list 0 -q) (list 0 -q) (list q 0)
            (list r 0) (list 0 r) (list 0 r) (list -r 0) (list -r 0) (list 0 -r) (list 0 -r) (list r 0)
        )
        (list 32
            (list  r r) (list -r -r) (list  r q) (list -q -r) (list  q r) (list -r -q)
            (list -r r) (list  r -r) (list -q r) (list  r -q) (list -r q) (list  q -r)
        )
        (list 64
            '( 0  1) (list  0  p) (list  0  p) (list -p  p) (list -p  p) (list -p -1) (list -p -1) '( 0 -1)
            '( 0 -1) (list  0 -p) (list  0 -p) (list  p -p) (list  p -p) (list  p  1) (list  p  1) '( 0  1)
            '( 1  2) (list  1  q) (list  1  q) (list -q  q) (list -q  q) (list -q -2) (list -q -2) '(-1 -2)
            '(-1 -2) (list -1 -q) (list -1 -q) (list  q -q) (list  q -q) (list  q  2) (list  q  2) '( 1  2)
        )
        (list 128
            (list (1+ -p) 0) '(0 0) '(0 0) (list 0 (1+ -p))
            (list (1+ -p) 1) '(1 1) '(1 1) (list 1 (1+ -p))
            (list -p q) (list -p -p) (list -p -p) (list q -p)
            (list -q q) (list -q -q) (list -q -q) (list q -q)
        )
        (vl-list* 256 (list -r r)  (list r r) (list -r (1+ r)) (list r (1+ r)) c)
        (list 512
            (list -p -p) (list  p -p) (list -p  p) (list p p) (list -q -q) (list  q -q)
            (list  q -q) (list -q  q) (list -q  q) (list q q) (list  q  q) (list -q -q)
        )
        (list 2048
            (list   -p     -p) (list    p      p) (list   -p      p) (list    p     -p)
            (list (+ p 05) -p) (list (+ p 06) -p) (list (+ p 05) -q) (list (+ p 06) -q)
            (list (+ p 09) -p) (list (+ p 10) -p) (list (+ p 09) -q) (list (+ p 10) -q)
            (list (+ p 13) -p) (list (+ p 14) -p) (list (+ p 13) -q) (list (+ p 14) -q)
            (list -p -p) (list p -p) (list p -p) (list p p) (list p p) (list -p p) (list -p p) (list -p -p)
            (list -q -q) (list q -q) (list q -q) (list q q) (list q q) (list -q q) (list -q q) (list -q -q)
        )
        (list 8192 (list r 1) (list -r -q) (list r 0) (list -r -r) (list r q) (list -r -1) (list r r) (list -r 0))
    )
)

;; Object Snap for grread: Parse Point  -  Lee Mac
;; bpt - [lst] Basepoint for relative point input, e.g. @5,5
;; str - [str] String representing point input
;; Returns: [lst] Point represented by the given string, else nil

(defun LM:grsnap:parsepoint ( bpt str / str-&amp;gt;lst lst )
 
    (defun str-&amp;gt;lst ( str / pos )
        (if (setq pos (vl-string-position 44 str))
            (cons (substr str 1 pos) (str-&amp;gt;lst (substr str (+ pos 2))))
            (list str)
        )
    )

    (if (wcmatch str "`@*")
        (setq str (substr str 2))
        (setq bpt '(0.0 0.0 0.0))
    )           

    (if
        (and
            (setq lst (mapcar 'distof (str-&amp;gt;lst str)))
            (vl-every 'numberp lst)
            (&amp;lt; 1 (length lst) 4)
        )
        (mapcar '+ bpt lst)
    )
)

;; Object Snap for grread: Snap Mode  -  Lee Mac
;; str - [str] Object Snap modifier
;; Returns: [int] Object Snap bit code for the given modifier, else nil

(defun LM:grsnap:snapmode ( str )
    (vl-some
        (function
            (lambda ( x )
                (if (wcmatch (car x) (strcat (strcase str t) "*"))
                    (progn
                        (princ (cadr x)) (caddr x)
                    )
                )
            )
        )
       '(
            ("endpoint"      " of " 00001)
            ("midpoint"      " of " 00002)
            ("center"        " of " 00004)
            ("node"          " of " 00008)
            ("quadrant"      " of " 00016)
            ("intersection"  " of " 00032)
            ("insert"        " of " 00064)
            ("perpendicular" " to " 00128)
            ("tangent"       " to " 00256)
            ("nearest"       " to " 00512)
            ("appint"        " of " 02048)
            ("parallel"      " to " 08192)
            ("none"          ""     16384)
        )
    )
)

;; OLE -&amp;gt; ACI  -  Lee Mac
;; Args: c - [int] OLE Colour

(defun LM:OLE-&amp;gt;ACI ( c )
    (apply 'LM:RGB-&amp;gt;ACI (LM:OLE-&amp;gt;RGB c))
)

;; OLE -&amp;gt; RGB  -  Lee Mac
;; Args: c - [int] OLE Colour

(defun LM:OLE-&amp;gt;RGB ( c )
    (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(24 16 8))
)

;; RGB -&amp;gt; ACI  -  Lee Mac
;; Args: r,g,b - [int] Red, Green, Blue values

(defun LM:RGB-&amp;gt;ACI ( r g b / c o )
    (if (setq o (vla-getinterfaceobject (LM:acapp) (strcat "autocad.accmcolor." (substr (getvar 'acadver) 1 2))))
        (progn
            (setq c (vl-catch-all-apply '(lambda ( ) (vla-setrgb o r g b) (vla-get-colorindex o))))
            (vlax-release-object o)
            (if (vl-catch-all-error-p c)
                (prompt (strcat "\nError: " (vl-catch-all-error-message c)))
                c
            )
        )
    )
)

;; Application Object  -  Lee Mac
;; Returns the VLA Application Object

(defun LM:acapp nil
    (eval (list 'defun 'LM:acapp 'nil (vlax-get-acad-object)))
    (LM:acapp)
)

;---------------------------------------------------------------------------------------------------

  (setq mid (getpoint "\nMidpoint of Line: "))
  (prompt "\nOne end of Line [Distance/Float]: ")
  (setq osf (LM:grsnap:snapfunction)) ; osnap
  (setq mode "F")
  (while
    (and mid (setq cur (grread T 12 0))) ; was 12, 13?
    (setq vs (/ (getvar "VIEWSIZE") 100.0))
    (redraw)

  (grvecs (list 1
				(polar mid 0 vs) (polar mid 1.57 vs)
				(polar mid 1.57 vs) (polar mid 3.14 vs)
				(polar mid 3.14 vs) (polar mid 4.71 vs)
				(polar mid 4.71 vs) (polar mid 6.28 vs)
           ))

    (cond
      ((= (car cur) 5); moved cursor - draw vector
	   (if (= mode "F")
	    (setq ospt (osf (cadr cur) (getvar "OSMODE")))
	    (setq ospt (polar mid (angle (cadr cur) mid) distf))
	   )
        (grdraw
          ospt ; (cadr cur)
		 (if (= mode "F")
           (polar mid (angle ospt mid) (distance ospt mid))
		  (polar mid (angle mid (cadr cur)) distf)
		 )
          -1 1 ; contrast color to background, highlight 1
        ); grdraw
      ); moved-cursor condition

      ((= (car cur) 3); picked point - draw Line, end (while) loop
	   (if (= mode "F")
	    (setq ospt (osf (cadr cur) (getvar "OSMODE")))
	    (setq ospt (polar mid (angle (cadr cur) mid) distf))
	   )
        (entmake
          (list
            '(0 . "LINE")
            (cons 10 ospt)
	       (if (= mode "F")
             (cons 11 (polar mid (angle ospt mid) (distance ospt mid)))
             (cons 11 (polar mid (angle mid (cadr cur)) distf))
	       )
          ); list
        ); entmake
        (setq mid nil); end (while) loop
      ); picked-point condition

	  ((= (car cur) 2)
	    (if (member (chr (cadr cur)) '("d" "D")) (progn (setq mode "D") (setq distf (getdist " Fixed distance: "))))
	    (if (member (chr (cadr cur)) '("f" "F")) (setq mode "F"))
	  )
	  ;(T (princ cur)) ; else
    ); cond - grread possibilities
  ); while
  (redraw)
  (princ)
); defun - LMP
(prompt "\nType LMP to draw a Line starting at its MidPoint. ")
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vladimir Michl, &lt;A href="http://www.arkance.world" target="_blank"&gt;www.arkance.world&lt;/A&gt;&amp;nbsp;- &lt;A href="http://www.cadforum.cz" target="_blank"&gt;www.cadforum.cz&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 14:10:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/draw-a-line-from-its-midpoint/m-p/14095035#M362817</guid>
      <dc:creator>vladimir_michl</dc:creator>
      <dc:date>2026-04-17T14:10:29Z</dc:date>
    </item>
  </channel>
</rss>

