<?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: AutoCAD offset bug? in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12373627#M26298</link>
    <description>&lt;P&gt;I see... thx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Offset: we have it localized as Ekvid... which is an artificial shortcut for Ekvidistanta (or Equidistant in eng)... none of it is really a local word, but I guess it is more understandable than offset. But still, I would like to hear some explanation why it's not "parallel".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2336192"&gt;@capuano3d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need a lisp to automate the process, here you go. Not sure whether Dynamo is an option for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:OffsetAtOrigin ( / *error* osm sel psel pside psideon ang oside cop off)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if osm (setvar 'osmode osm))
    (princ))
  
  (or *off0-dst* (setq *off0-dst* (abs (getvar 'offsetdist))))
  (setq *off0-dst* (cond ((getdist (strcat "\nSpecify offset distance &amp;lt;" (rtos *off0-dst*) "&amp;gt;: "))) (*off0-dst*)))
  (setq osm (getvar 'osmode))
  
  (while (and (setq sel (entsel "\nSelect object to offset: "))
	      (or (= "LWPOLYLINE" (cdr (assoc 0 (entget (car sel)))))
		  (prompt "\nError: Selected object is not polyline."))
	      (setq org (vlax-ename-&amp;gt;vla-object (car sel)))
	      (setq psel (trans (cadr sel) 1 0))
	      (setvar 'osmode 0)
	      (setq pside (getpoint "\nSpecify point on side to offset: "))
	      (setq pside (trans pside 1 0))
	      )
    
    (setq psideon (vlax-curve-getclosestpointto org pside))
    (setq ang (- (angle (vlax-curve-getfirstderiv org (vlax-curve-getParamAtPoint org psideon)) '(0 0 0))
		 (angle psideon pside)))
    (setq oside (if (or (equal ang (* pi 0.5) 1e-6)
			(equal ang (* pi -1.5) 1e-6)
			)
		  -1
		  +1))
    (setq cop (vla-copy org))
    (vla-move cop (vlax-3d-point psel) (vlax-3d-point '(0 0 0)))
    (setq off (vlax-invoke cop 'Offset (* *off0-dst* oside)))
    (foreach obj off
      (vla-move obj (vlax-3d-point '(0 0 0)) (vlax-3d-point psel)))
    (vla-erase cop)
    )
  (*error* "end")
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2023 11:55:39 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2023-11-13T11:55:39Z</dc:date>
    <item>
      <title>AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12346492#M26290</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In trying to offset the polyline in the image, instead of as expected getting a full polyline, the outcome is actually several 'partitioned' polylines. In the image the red was offset from the green 0.35 units upwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="capuano3d_0-1698847738709.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286876i58EE7A647B7D040E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="capuano3d_0-1698847738709.png" alt="capuano3d_0-1698847738709.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd say it's an AutoCAD bug - here for someone maybe to confirm or for the record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dwg attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:12:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12346492#M26290</guid>
      <dc:creator>capuano3d</dc:creator>
      <dc:date>2023-11-01T14:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12346536#M26291</link>
      <description>&lt;P&gt;Well, now and then this happens. Coords are high, lengthy polyline... the process ran out of valid digits of precision.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Move it towards 0,0, do the offset, then move it back.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:26:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12346536#M26291</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-11-01T14:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370437#M26292</link>
      <description>&lt;P&gt;Hi there, it turns up that this problem is happening quite frequently in our project, with many different polylines, which is very worrying as they are long polylines that will be used for quantification purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know by any chance of some lisp/vba/.net routine or other method that would work more reliably, as unfortunately it ends up that we can't trust AutoCAD offset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 09:14:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370437#M26292</guid>
      <dc:creator>capuano3d</dc:creator>
      <dc:date>2023-11-11T09:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370783#M26293</link>
      <description>&lt;P&gt;AutoCAD stores coordinates to about 15 significant digits.&amp;nbsp; By positioning the polyline as you have a million units frm the origin you have consumed 7 of them for positioning which still leaves about 8 decimal places to work with.&amp;nbsp; I am not sure why offset fails to create an offset at the positions noted below on your orginal drawing.&amp;nbsp; It could have to do with difficulty in calculating the center of curvature and bulge for an object far away from 0,0,0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leeminardi_0-1699717038544.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1291806i37BF5DA0CB80FA3B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leeminardi_0-1699717038544.png" alt="leeminardi_0-1699717038544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Offset worked fine when the polyline was moved so that one end was at 0,0,0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a strong reason for positioning the lines a million units from World origin?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 15:40:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370783#M26293</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2023-11-11T15:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370822#M26294</link>
      <description>Thanks for your insights. Even with your explanation I struggle a bit to&lt;BR /&gt;understand the malfunctioning - sounds like we have just to accept and live&lt;BR /&gt;along it.&lt;BR /&gt;&lt;BR /&gt;And yes there's a reason - it's a georeferenced asset, which interacts with&lt;BR /&gt;other systems.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 11 Nov 2023 16:17:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370822#M26294</guid>
      <dc:creator>capuano3d</dc:creator>
      <dc:date>2023-11-11T16:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370887#M26295</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;AutoCAD stores coordinates to about 15 significant digits.&amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok, we both know this... but how would you explain that when I open it in Br1cs, it makes an offset without blinking?&lt;/P&gt;
&lt;P&gt;There are obviously some methods to avoid this issue...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2336192"&gt;@capuano3d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does moving it toward 0,0 always solve the issue? If so, that could be automated by lisp routine.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 17:11:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370887#M26295</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-11-11T17:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370978#M26296</link>
      <description>&lt;P&gt;Maybe that software uses other calculation methods. The core is more modern and younger than the AutoCAD core. Maybe it internally calculates with a local coordinate system or uses a different mathematical approach.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Dynamo, for example, large coordinates are also a problem, but at least you are able to script the movement towards 0.0 and back yourself.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 18:54:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12370978#M26296</guid>
      <dc:creator>Anton_Huizinga</dc:creator>
      <dc:date>2023-11-11T18:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12371200#M26297</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;AutoCAD stores coordinates to about 15 significant digits.&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, we both know this... but how would you explain that when I open it in Br1cs, it makes an offset without blinking?&lt;/P&gt;&lt;P&gt;There are obviously some methods to avoid this issue...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;I don't know why but studying when and where offset fails for the polyline far from 0,0 I'll take a wild guess!&amp;nbsp; Some of the arc segments are only slightly tangent with adjacent straight or arc segements.&amp;nbsp; The green lines in the image below are radial lines for arc segments.&amp;nbsp; For tangent arc segement they should share a radial line (some don't). The offset failed at #1 but not at #2!&amp;nbsp; &amp;nbsp;In creating the offset geometry&amp;nbsp;the calcuation of the intersection point of the offset arc with an offset line (or another arc) is first alculated. If this is done numerically the computation may stop if a desired precision is not reached within the maximum iterations allowed.&amp;nbsp; That threshold may be reached sooner if with the reduced precision of geometry far from the world origin.&lt;/P&gt;&lt;P&gt;There may also be a sensitivity to whether the offset arc needs to be extended or trimmed beyond the angle of the orginal arc.&amp;nbsp; This can be seen by the fact that where offset fails is different for one side than the other.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leeminardi_0-1699741229071.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1291857i82334D8D886E37B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leeminardi_0-1699741229071.png" alt="leeminardi_0-1699741229071.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Offset&lt;/STRONG&gt; is probably one of the first commands implemented in AutoCAD. I remember coming from another CAD system in the early 80's and trying out AutoCAD for the first time.&amp;nbsp; I struggled&amp;nbsp; looking for the "parallel" command and couldn't find it and then wondering who the hell named it "offset"!&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 22:22:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12371200#M26297</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2023-11-11T22:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD offset bug?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12373627#M26298</link>
      <description>&lt;P&gt;I see... thx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Offset: we have it localized as Ekvid... which is an artificial shortcut for Ekvidistanta (or Equidistant in eng)... none of it is really a local word, but I guess it is more understandable than offset. But still, I would like to hear some explanation why it's not "parallel".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2336192"&gt;@capuano3d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need a lisp to automate the process, here you go. Not sure whether Dynamo is an option for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:OffsetAtOrigin ( / *error* osm sel psel pside psideon ang oside cop off)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if osm (setvar 'osmode osm))
    (princ))
  
  (or *off0-dst* (setq *off0-dst* (abs (getvar 'offsetdist))))
  (setq *off0-dst* (cond ((getdist (strcat "\nSpecify offset distance &amp;lt;" (rtos *off0-dst*) "&amp;gt;: "))) (*off0-dst*)))
  (setq osm (getvar 'osmode))
  
  (while (and (setq sel (entsel "\nSelect object to offset: "))
	      (or (= "LWPOLYLINE" (cdr (assoc 0 (entget (car sel)))))
		  (prompt "\nError: Selected object is not polyline."))
	      (setq org (vlax-ename-&amp;gt;vla-object (car sel)))
	      (setq psel (trans (cadr sel) 1 0))
	      (setvar 'osmode 0)
	      (setq pside (getpoint "\nSpecify point on side to offset: "))
	      (setq pside (trans pside 1 0))
	      )
    
    (setq psideon (vlax-curve-getclosestpointto org pside))
    (setq ang (- (angle (vlax-curve-getfirstderiv org (vlax-curve-getParamAtPoint org psideon)) '(0 0 0))
		 (angle psideon pside)))
    (setq oside (if (or (equal ang (* pi 0.5) 1e-6)
			(equal ang (* pi -1.5) 1e-6)
			)
		  -1
		  +1))
    (setq cop (vla-copy org))
    (vla-move cop (vlax-3d-point psel) (vlax-3d-point '(0 0 0)))
    (setq off (vlax-invoke cop 'Offset (* *off0-dst* oside)))
    (foreach obj off
      (vla-move obj (vlax-3d-point '(0 0 0)) (vlax-3d-point psel)))
    (vla-erase cop)
    )
  (*error* "end")
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 11:55:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/autocad-offset-bug/m-p/12373627#M26298</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-11-13T11:55:39Z</dc:date>
    </item>
  </channel>
</rss>

