<?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: get polyline segment radius in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593057#M142332</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; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;If you'd let on that's what you were going to use it for, I could have directly supplied the attached &lt;STRONG&gt;FilletMatchRad.lsp&lt;/STRONG&gt; with its &lt;STRONG&gt;FMR&lt;/STRONG&gt; command.&amp;nbsp; ....&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A remarkable coincidence:&amp;nbsp; I had recently sent that routine in to the&amp;nbsp;Cadalyst CAD Tips website, and after poking around here, I went over there, and lo and behold,&amp;nbsp;&lt;EM&gt;today&lt;/EM&gt; they have put it up as &lt;A href="http://cadtips.cadalyst.com/2d-editing/fillet-match-radius" target="_self"&gt;Tip #4458&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Apr 2015 13:31:30 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2015-04-15T13:31:30Z</dc:date>
    <item>
      <title>get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592665#M142321</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to get polyline segment radius as an argument by picking the segment of polyline or arc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq&lt;BR /&gt;aobj (car (entsel "\nSelect curve:\n"))&lt;BR /&gt;vobj (vlax-ename-&amp;gt;vla-object aobj)&lt;BR /&gt;rad (vlax-get-property vobj 'Radius)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works only with arcs &amp;amp; circles..&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 08:33:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592665#M142321</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2015-04-15T08:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592691#M142322</link>
      <description>&lt;P&gt;Look into (_plsegrad) subfunction from this post :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-for-dimension-angle-and-radius-lisp/m-p/5587223/highlight/true#M331388" target="_blank"&gt;http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-for-dimension-angle-and-radius-lisp/m-p/5587223/highlight/true#M331388&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH, M.R.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 09:00:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592691#M142322</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2015-04-15T09:00:50Z</dc:date>
    </item>
    <item>
      <title>Re : get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592731#M142323</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An old program.&lt;/P&gt;&lt;P&gt;It's working with ARC, CIRCLE and old or new POLYLINE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun near_vertex_arr (obj / dxf_obj l_10 l_40 l_41 l_42 dxf_39 e_next dxf_next dxf_43 dxf_38 obj_vlax pt_sel par pt_first pt_snd i bulge)
    (setq dxf_obj (entget (car obj)) l_10 nil l_40 nil l_41 nil l_42 nil)
    (cond
        ((eq (cdr (assoc 0 dxf_obj)) "POLYLINE")
            (if (cdr (assoc 39 dxf_obj))
                (setq dxf_39 (cdr (assoc 39 dxf_obj)))
                (setq dxf_39 0.0)
            )
            (setq e_next (entnext (car obj)))
            (while (= "VERTEX" (cdr (assoc 0 (setq dxf_next (entget e_next)))))
                (if (zerop (boole 1 (cdr (assoc 70 dxf_next)) 16))
                    (setq
                        l_10 (cons (cdr (assoc 10 dxf_next)) l_10)
                        l_40 (cons (cdr (assoc 40 dxf_next)) l_40)
                        l_41 (cons (cdr (assoc 41 dxf_next)) l_41)
                        l_42 (cons (cdr (assoc 42 dxf_next)) l_42)
                    )
                )
                (setq e_next (entnext e_next))
            )
            (setq
                l_10 (reverse l_10)
                l_40 (reverse l_40)
                l_41 (reverse l_41)
                l_42 (mapcar '(lambda (x) (cons 42 x)) (reverse l_42))
            )
            (if (and (equal (apply 'max l_40) (apply 'min l_40)) (equal (apply 'max l_41) (apply 'min l_41)))
                (setq dxf_43 (car l_40) l_40 nil l_41 nil)
                (setq
                    dxf_43 nil
                    l_40 (mapcar '(lambda (x) (cons 40 x)) l_40)
                    l_41 (mapcar '(lambda (x) (cons 41 x)) l_41)
                )
            )
            (if (not (zerop (caddar l_10)))
                (setq dxf_38 (caddar l_10))
                (setq dxf_38 0.0)
            )
            (setq l_10 (mapcar '(lambda (x) (cons 10 (list (car x) (cadr x)))) l_10))
            (entdel (car obj))
            (entmake
                (append
                    (list
                        (cons 0 "LWPOLYLINE")
                        (cons 100 "AcDbEntity")
                        (assoc 67 dxf_obj)
                        (assoc 410 dxf_obj)
                        (assoc 8 dxf_obj)
                        (if (assoc 62 dxf_obj) (assoc 62 dxf_obj) (cons 62 256))
                        (if (assoc 6 dxf_obj) (assoc 6 dxf_obj) (cons 6 "BYLAYER"))
                        (if (assoc 370 dxf_obj) (assoc 370 dxf_obj) (cons 370 -1))
                        (cons 100 "AcDbPolyline")
                        (cons 90 (length l_10))
                        (cons 70
                            (if (zerop (boole 1 (rem (cdr (assoc 70 dxf_obj)) 128) 1))
                                (boole 1 (cdr (assoc 70 dxf_obj)) 128)
                                (1+ (boole 1 (cdr (assoc 70 dxf_obj)) 128))
                            )
                        )
                        (cons 38 dxf_38)
                        (cons 39 dxf_39)
                    )
                    (if (and l_40 l_41)
                        (apply 'append
                            (mapcar
                                '(lambda (x10 x40 x41 x42)
                                    (append (list x10 x40 x41 x42))
                                )
                                l_10 l_40 l_41 l_42
                            )
                        )
                        (progn
                            (cons 43 dxf_43)
                            (apply 'append
                                (mapcar
                                    '(lambda (x10 x42)
                                        (list x10 x42)
                                    )
                                    l_10 l_42
                                )
                            )
                        )
                    )
                    (list (assoc 210 dxf_obj))
                )
            )
            (setq obj (cons (entlast) (list (cadr obj))) dxf_obj (entget (car obj)))
        )
        (T (entupd (car obj)))
    )
    (vl-load-com)
    (setq
        obj_vlax (vlax-ename-&amp;gt;vla-object (car obj))
        pt_sel (osnap (cadr obj) "_near")
    )
    (if (null pt_sel)
        (progn
            (while (null (setq e_next (entsel "\nDétermination du segment imprécise, resélectionnez: "))))
            (setq pt_sel (osnap (cadr e_next) "_near"))
        )
    )
    (setq
        pt_sel (vlax-curve-getClosestPointTo obj_vlax (trans pt_sel 1 0))
        par (vlax-curve-getParamAtPoint obj_vlax pt_sel)
        pt_first (trans (vlax-curve-getPointAtParam obj_vlax (fix par)) 0 1)
        pt_snd (trans (vlax-curve-getPointAtParam obj_vlax (1+ (fix par))) 0 1)
        i 0
    )
    (while (or (/= (caar dxf_obj) 42) (if (&amp;lt; i (fix par)) (setq i (1+ i))))
        (setq bulge (cdadr dxf_obj) dxf_obj (cdr dxf_obj))
    )
    (list pt_first pt_snd bulge)
)
(defun c:q_ray ( / old_osmd pt_sel ent dxf_ent typ_ent id_rad l_2pt)
    (setvar "cmdecho" 0)
    (while (not (setq ent (entsel "\nInterroger le rayon du segment arrondi: "))))
    (setq dxf_ent (entget (car ent)) typ_ent (cdr (assoc 0 dxf_ent)))
    (cond
        ((or (eq typ_ent "ARC") (eq typ_ent "CIRCLE"))
            (setq id_rad (cdr (assoc 40 dxf_ent)))
        )
        ((or (eq typ_ent "LWPOLYLINE")
            (and
                (eq typ_ent "POLYLINE")
                (zerop (boole 1 120 (cdr (assoc 70 dxf_ent))))
            )
        )
            (setq l_2pt (near_vertex_arr ent))
            (if (zerop (caddr l_2pt))
                (progn
                    (setq id_rad nil)
                    (princ "\nCe segment est droit et ne peut être interrogé!")
                )
                (setq id_rad (/ (distance (car l_2pt) (cadr l_2pt)) (sin (* 2.0 (atan (caddr l_2pt)))) 2.0))
            )
        )
        (T
            (setq id_rad nil)
            (princ "\nCet objet ne peut être interrogé!")
        )
    )
    (if (eq (type id_rad) 'REAL)
        (progn
            (alert
                (strcat
                    "\nRayon = "
                    (rtos (abs id_rad) 2 3)
                )
            )
            (princ
                (strcat
                    "\nRayon = "
                    (rtos (abs id_rad) 2 3)
                )
            )
        )
    )
    (setvar "cmdecho" 1)
    (princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 09:54:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592731#M142323</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2015-04-15T09:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592787#M142324</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;sorry, i'm not sure how to turn to the subfunction&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;SPAN style="color: #000000; font-family: FrutigerNextW04-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;"&gt;(setq&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN style="color: #000000; font-family: FrutigerNextW04-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;"&gt;aobj (car (entsel "\nSelect curve:\n"))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN style="color: #000000; font-family: FrutigerNextW04-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;"&gt;vobj (vlax-ename-&amp;gt;vla-object aobj)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN style="color: #000000; font-family: FrutigerNextW04-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;"&gt;rad (_plsegrad ....)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN style="color: #000000; font-family: FrutigerNextW04-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;"&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;(defun _plsegrad ( obj pt / n p1 p2 bulge rad )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq n (fix (vlax-curve-getparamatpoint obj (vlax-curve-getclosestpointto obj pt))))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq p1 (vlax-curve-getpointatparam obj (float n)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq p2 (vlax-curve-getpointatparam obj (float (1+ n))))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq bulge (vla-getbulge obj (float n)))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (/= bulge 0.0)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq rad (/ (distance p1 p2) (* 2 (sin (* 2 (atan bulge))))))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (abs rad)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&amp;nbsp; )&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 10:52:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592787#M142324</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2015-04-15T10:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592801#M142325</link>
      <description>&lt;P&gt;A simple way to get polyline's radius&lt;/P&gt;&lt;PRE&gt;(defun get_radius (e p)
  (distance
    '(0 0 0)
    (vlax-curve-getsecondderiv e
      (vlax-curve-getparamatpoint e
        (vlax-curve-getclosestpointto e p)
      )
    )
  )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is a test function, using the same principle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:RADIUS (/ e)
  (setvar 'errno 0)
  (while
    (or
      (setq e (entsel "\nSelect a circle, arc or polyline: "))
      (= (getvar 'errno) 7)
    )
    (if
      (and e (wcmatch (cdr (assoc 0 (entget (car e))))  "CIRCLE,ARC,*POLYLINE"))
      (print
        (distance
          '(0 0 0)
          (vlax-curve-getsecondderiv (car e)
            (vlax-curve-getparamatpoint (car e)
              (vlax-curve-getclosestpointto (car e) (cadr e))
            )
          )
        )
      )
      (princ "\nInvalid object.")
    )
    (setvar 'errno 0)
  )
  (princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 11:12:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592801#M142325</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2015-04-15T11:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592855#M142326</link>
      <description>&lt;P&gt;Good point phanaem, thank!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I use pedit and fit a lwpolyline, it don't work at every time ?!?!&lt;/P&gt;&lt;P&gt;I can obtain:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command:&amp;nbsp; RADIUS&lt;BR /&gt;Select a circle, arc or polyline: ; erreur: type d'argument incorrect: numberp: nil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You know why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[EDIT]&lt;/P&gt;&lt;P&gt;This is occured then I works with many number in coordinates. ex: 15666478.23,9853647.21 etc...&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 11:56:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592855#M142326</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2015-04-15T11:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592861#M142327</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/275621"&gt;@robert06&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to get polyline segment radius as an argument by picking the segment of polyline or arc&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here's the command I've used for years:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:RAD (/ pt); report RADius of curve&lt;BR /&gt;&amp;nbsp; ; [e.g. Polyline Arc segment, whose radius does not appear in Properties box or List result]&lt;BR /&gt;&amp;nbsp; (setq aper (getvar 'aperture))&lt;BR /&gt;&amp;nbsp; (while&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (not (setq pt (cadr (entsel "Select curve: "))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt "\nNothing selected -- ")&lt;BR /&gt;&amp;nbsp; ); end while&lt;BR /&gt;&amp;nbsp; (setvar 'aperture (getvar 'pickbox))&lt;BR /&gt;&amp;nbsp; (if (osnap pt "cen")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt (strcat "\nRadius is " (rtos (distance (osnap pt "nea") (osnap pt "cen"))) "."))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt "\nNo radius for that object.")&lt;BR /&gt;&amp;nbsp; ); end if&lt;BR /&gt;&amp;nbsp; (setvar 'aperture aper)&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could have it not just report the radius, but also save it to a variable:&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (if (osnap pt "cen")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt (strcat "\nRadius is " (rtos &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;(setq rad&lt;/STRONG&gt; &lt;/FONT&gt;(distance (osnap pt "nea") (osnap pt "cen"))&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;) "."))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt "\nNo radius for that object.")&lt;BR /&gt;&amp;nbsp; ); end if&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works on not only Circles, Arcs, and Polyline arc segments, but even edges of 3DSolids and Regions that were generated from those, and the dimension-line arcs of angular Dimensions [as if you'd ever want to know the radius of one of those...].&amp;nbsp; And it rejects fit-curved or spline-curved Polylines.&amp;nbsp; However, it will also report a "radius" for an Ellipse, which will vary depending on where you pick it.&amp;nbsp; I have a way to prevent that, worked out in a different routine, that I haven't incorporated into this one yet, but some time soon....&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 12:02:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592861#M142327</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-04-15T12:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592873#M142328</link>
      <description>I don't know what is the error, but these polyline must be filtered out. The lisp should return a value on polylines like this, but is not the radius. It can be the local curvature, but I didn't checked.</description>
      <pubDate>Wed, 15 Apr 2015 12:00:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592873#M142328</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2015-04-15T12:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592963#M142329</link>
      <description>&lt;P&gt;Thank you all, I used Kent Cooper's version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:fsr ( / pt rad) ;; Fillet with radius from picked curve&lt;BR /&gt;(setq pt (cadr (entsel "Select curve: ")))&lt;BR /&gt;(if (osnap pt "cen")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt (strcat "\nRadius is " (rtos (setq rad (distance (osnap pt "nea") (osnap pt "cen")))) "."))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (prompt "\nNo radius for that object.")&lt;BR /&gt;&amp;nbsp; ); end if&lt;/P&gt;&lt;P&gt;(setvar "cmdecho" 0)&lt;BR /&gt;(command "filletrad" rad)&lt;BR /&gt;(setvar "cmdecho" 1)&lt;BR /&gt;(terpri)&lt;BR /&gt;(command "_.fillet" pause pause)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 12:52:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592963#M142329</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2015-04-15T12:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592976#M142330</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/275621"&gt;@robert06&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;...&amp;nbsp;;; Fillet with radius from picked curve&lt;BR /&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you'd let on that's what you were going to use it for, I could have directly supplied the attached &lt;STRONG&gt;FilletMatchRad.lsp&lt;/STRONG&gt; with its &lt;STRONG&gt;FMR&lt;/STRONG&gt; command.&amp;nbsp; It's quite similar to yours, obviously, but also has an error handler and a little "insurance"&amp;nbsp;that&amp;nbsp;the detected center of the curve is of the &lt;EM&gt;right&lt;/EM&gt; curve, if there might be any others in the vicinity.&amp;nbsp; And it lets you Fillet as many things at that radius as you want [not just once], all in one running of the command.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 13:02:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592976#M142330</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-04-15T13:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592994#M142331</link>
      <description>&lt;P&gt;Thank you, Kent, as it's more advanced than my lispy, i'll use FMR.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 13:09:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5592994#M142331</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2015-04-15T13:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593057#M142332</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; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;If you'd let on that's what you were going to use it for, I could have directly supplied the attached &lt;STRONG&gt;FilletMatchRad.lsp&lt;/STRONG&gt; with its &lt;STRONG&gt;FMR&lt;/STRONG&gt; command.&amp;nbsp; ....&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A remarkable coincidence:&amp;nbsp; I had recently sent that routine in to the&amp;nbsp;Cadalyst CAD Tips website, and after poking around here, I went over there, and lo and behold,&amp;nbsp;&lt;EM&gt;today&lt;/EM&gt; they have put it up as &lt;A href="http://cadtips.cadalyst.com/2d-editing/fillet-match-radius" target="_self"&gt;Tip #4458&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 13:31:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593057#M142332</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-04-15T13:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593112#M142333</link>
      <description>&lt;P&gt;I think that vlax-curve-getclosestpointto don't work properly with the old polyline and greatest coordinates (when i fit a Lwpolyline, this became an old polyline)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have encountered some problem before in other case with vlax-curve-getclosestpointto: it don't return a point but nil, if I move near to 0,0 it can find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 13:55:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593112#M142333</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2015-04-15T13:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593175#M142334</link>
      <description>&lt;P&gt;Good for you, Kent, the lisp is worth recognition &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I did not post 'accepted as solution' with this thread, as other versions posted might work as well getting the segment radius, just could not test all of those.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 14:24:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593175#M142334</guid>
      <dc:creator>robert06</dc:creator>
      <dc:date>2015-04-15T14:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593443#M142335</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/524107"&gt;@CADaSchtroumpf&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;I think that vlax-curve-getclosestpointto don't work properly with the old polyline and greatest coordinates (when i fit a Lwpolyline, this became an old polyline)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have encountered some problem before in other case with vlax-curve-getclosestpointto: it don't return a point but nil, if I move near to 0,0 it can find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, sometimes vlax-curve functions act like this. I think it is a rounding issue.&lt;/P&gt;&lt;P&gt;Try this new version. It works with plane polylines (meaning not 3D rotated).&lt;/P&gt;&lt;PRE&gt;(defun C:RADIUS (/ d e el)
  (setvar 'errno 0)
  (while
    (or
      (setq e (entsel "\nSelect a circle, arc or polyline: "))
      (= (getvar 'errno) 7)
    )
    (if
      (and
        e
        (wcmatch (cdr (assoc 0 (setq el (entget (car e)))))  "CIRCLE,ARC,*POLYLINE")
        (or
          (not (setq d (cdr (assoc 70 el))))
          (zerop (logand d (+ 4 8 16 64)))
        )
      )
      (print (getrad (car e) (cadr e)))
      (princ "\nInvalid object.")
    )
    (setvar 'errno 0)
  )
  (princ)
)

(defun getrad (e p / r)
  (if
    (not
      (vl-catch-all-error-p
        (setq r
          (vl-catch-all-apply
            (function
              (lambda nil
                (distance
                  '(0 0 0)
                  (vlax-curve-getsecondderiv e
                    (vlax-curve-getparamatpoint e
                      (vlax-curve-getclosestpointtoprojection e
                        (trans p 1 0) (trans (getvar 'viewdir) 1 0 T)
                      )
                    )
                  )
                )
              )
            )
          )
        )
      )
    )
    r
    (not (princ (strcat "\nError: " (vl-catch-all-error-message r))))
   )
 )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2015 16:24:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5593443#M142335</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2015-04-15T16:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5594682#M142336</link>
      <description>&lt;P&gt;For me, is not better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For illustrating the problem, try with this simple entitie.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(foreach n
'(
(
(0 . "POLYLINE")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDb2dPolyline")
(66 . 1)
(10 0.0 0.0 0.0)
(70 . 2)
(40 . 0.0)
(41 . 0.0)
(210 0.0 0.0 1.0)
(71 . 0)
(72 . 0)
(73 . 0)
(74 . 0)
(75 . 0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 660867.0 6.42101e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.28741)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 670003.0 6.46973e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.309998)
(91 . 0)
(70 . 1)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 715363.0 6.48008e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.453255)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 727466.0 6.44619e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.528215)
(91 . 0)
(70 . 1)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 742124.0 6.41688e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.542259)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 762123.0 6.44005e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.536005)
(91 . 0)
(70 . 1)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 782022.0 6.46355e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.244767)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 796073.0 6.45403e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.227579)
(91 . 0)
(70 . 1)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 810730.0 6.44338e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . 0.356781)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 837965.0 6.45842e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.355991)
(91 . 0)
(70 . 1)
(50 . 0.0)
)
(
(0 . "VERTEX")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbVertex")
(100 . "AcDb2dVertex")
(10 865225.0 6.47352e+006 0.0)
(40 . 0.0)
(41 . 0.0)
(42 . -0.377533)
(91 . 0)
(70 . 0)
(50 . 0.0)
)
(
(0 . "SEQEND")
(67 . 0)
(410 . "Model")
(8 . "0")
)
)
(entmake n)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Paste it directly in command line and make zoom extent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My version Q_RAY work's with this, and also FMR of Kent (if I add underscore to the option of the (osnap) function "_near"&amp;nbsp; for french version)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 10:06:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5594682#M142336</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2015-04-16T10:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5594844#M142337</link>
      <description>It works here. Tests made in A2014 and A2015, no problem found.&lt;BR /&gt;Anyway, since your lisp works, I don't see any reason to discuss any further on my lisp.&lt;BR /&gt;If you are looking for something else, please open a new topic.&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Apr 2015 12:17:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5594844#M142337</guid>
      <dc:creator>phanaem</dc:creator>
      <dc:date>2015-04-16T12:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5594930#M142338</link>
      <description>&lt;P&gt;In Autocad Map 3D 2014, work's sometime on vertex, for another one it don't work !!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am only interested by your shortest solution, but this , for me, isn't always reliability.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps somebody else can be have an explanation of this fact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warmly&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 13:07:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5594930#M142338</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2015-04-16T13:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: get polyline segment radius</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5595103#M142339</link>
      <description>&lt;P&gt;I have finds a solution.&lt;/P&gt;&lt;P&gt;For greatest coordinates, object must be moved for (vlax-curve-getparamatpoint) return a value and not nil.&lt;/P&gt;&lt;P&gt;This always work.&lt;/P&gt;&lt;PRE&gt;(defun C:RADIUS (/ e vlaobj mkv vector)
  (setvar 'errno 0)
  (while
    (or
      (setq e (entsel "\nSelect a circle, arc or polyline: "))
      (= (getvar 'errno) 7)
    )
    (setq vlaobj (vlax-ename-&amp;gt;vla-object (car e)))
    (if
      (and e (wcmatch (cdr (assoc 0 (entget (car e))))  "CIRCLE,ARC,*POLYLINE"))
      (progn
        (if (or (&amp;gt; (fix (car (trans (cadr e) 1 0))) 1E6) (&amp;gt; (fix (cadr (trans (cadr e) 1 0))) 1E6))
          (setq mkv T vector (trans (cadr e) 0 0 T))
          (setq mkv nil vector '(0.0 0.0 0.0))
        )
        (if mkv (vla-move vlaobj (vlax-3d-point (trans (cadr e) 1 0)) (vlax-3d-point '(0.0 0.0 0.0))))
        (print
          (distance
            '(0 0 0)
            (vlax-curve-getsecondderiv (car e)
              (vlax-curve-getparamatpoint (car e)
                (vlax-curve-getclosestpointto (car e) (if mkv '(0.0 0.0 0.0) (trans (cadr e) 1 0)))
              )
            )
          )
        )
        (if mkv (vla-move vlaobj (vlax-3d-point '(0.0 0.0 0.0)) (vlax-3d-point vector)))
      )
      (princ "\nInvalid object.")
    )
    (setvar 'errno 0)
  )
  (princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thank for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 14:21:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-polyline-segment-radius/m-p/5595103#M142339</guid>
      <dc:creator>CADaSchtroumpf</dc:creator>
      <dc:date>2015-04-16T14:21:55Z</dc:date>
    </item>
  </channel>
</rss>

