<?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>tema Re: Lisp Routine wont work on other computer. en AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169079#M943253</link>
    <description>&lt;P&gt;Which is why i explained to him to use my reset command before starting new duct. It sets DS to nil.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the lisp so offset isn't in play, it is now working for him.&lt;/P&gt;&lt;P&gt;Thank you everybody for the help.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Aug 2018 00:32:47 GMT</pubDate>
    <dc:creator>MRummler</dc:creator>
    <dc:date>2018-08-01T00:32:47Z</dc:date>
    <item>
      <title>Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8168944#M943240</link>
      <description>&lt;P&gt;I have a lisp that is meant for lined duct work that i created for myself. I tried to give it to a coworker and it failed to work in their AutoCAD only drawing half of the lined duct... when he tried my reducer it was all in the same x coordinate making it look like a straight line up the y axis. Why does it work for me and not him? (p.s. I have AutoCAD 2017, he has AutoCAD 2018.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my straight lined duct code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:NewLinedDuct ()
  (setvar "orthomode" 1)
  (setq layr (getvar "clayer"))
  (if (= ds nil)
    (setq ds 999)
  )
  (if (= ds 999)
    (progn
      (setq ds	(getreal "\nSheet metal Size?")
	    ld	(getreal "\nEnter Liner Width")
	    pt1	(getpoint "\nSelect Starting Point...")
      )
      (setq pt2 (getpoint pt1 "\nSelect End Point"))
    )
    (progn
      (setq pt2 (getpoint pt1 "\nSelect End Point"))
    )
  )
  (command "-layer" "m" "M-DUCT" "c" "magenta" "M-DUCT" "")
  (setq an1 (angle pt1 pt2))
  (command "line" pt1 pt2 "")
  (setq	ss1 (ssget pt1)
	nm1 (/ ds 2)
  )
  (setq nm2 (- nm1 ld))
  (setq	pt3 (polar pt1 (- an1 (/ pi 2.0)) 1)
	pt4 (polar pt1 (+ an1 (/ pi 2.0)) 1)
  )
;pt3 is point on one end of line
;pt4 is point on other end of line
;(it doesnt matter which is which side for now.)
  (command "offset" nm1 ss1 pt3 "")
  (command "offset" nm1 ss1 pt4 "")
  (command "chprop" ss1 "" "c" "Green" "LT" "Hidden2" "")
  (command "offset" nm2 ss1 pt4 "")
  (setq ssx (ssget "l"))
  (command "offset" nm2 ss1 pt3 "")
  (setq ssy (ssget "l"))
  (command "erase" ss1 "")
  (setvar "clayer" layr)
  (if (and ssxt ssyt)
    (progn
      (command "fillet" ssx ssxt)
      (command "fillet" ssy ssyt)
      (setq ssyt nil
	    ssxt nil)
      )
    )
  (setq pt1 pt2)
  (setvar "snapang" an1)
  (princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 22:09:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8168944#M943240</guid>
      <dc:creator>MRummler</dc:creator>
      <dc:date>2018-07-31T22:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8168979#M943242</link>
      <description>Without trying your utility:&lt;BR /&gt;(setq	ss1 (ssget pt1)&lt;BR /&gt;will become a selection set.&lt;BR /&gt;"ss1" is not needed as shown below.&lt;BR /&gt;&lt;BR /&gt;Offset expects a point selection and not a object [for your case it is a member of a selection set].&lt;BR /&gt;Try selecting the newly created object using polar:&lt;BR /&gt;(setq pt1 (polar pt1 an1 (/ (distance pt1 pt2) 2.0)))&lt;BR /&gt;&lt;BR /&gt;Now it's ready:&lt;BR /&gt;(command-s ".Offset" nm1 pt1 pt3 "")&lt;BR /&gt;&lt;BR /&gt;Other items to consider is to suppress OSMODE. Once the user has input the values,&lt;BR /&gt;add 16384 to OSMODE before invoking commands and subtract when finished.&lt;BR /&gt;You did not check if all user inputs are valid before invoking the commands.&lt;BR /&gt;&lt;BR /&gt;???&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2018 22:50:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8168979#M943242</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2018-07-31T22:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169000#M943244</link>
      <description>&lt;P&gt;The thing is that the offset works fine on my autocad i get the 4 lines. the inner lines should be "ld" units from the outer lines while outer lines are "ds"/2 distance from the middle. on my coworkers computer he gets one outer line and one inner line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was still brand new with lisp when i started this lisp routine, i realized faster ways to make it work, but didn't see a point in changing what already worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but, I cant figure out why it wont work on his but works on mine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will attach a picture of what i mean.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(update: In picture i labeled the endpoint as pt3, i meant pt2.)&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 23:22:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169000#M943244</guid>
      <dc:creator>MRummler</dc:creator>
      <dc:date>2018-07-31T23:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169023#M943245</link>
      <description>&lt;P&gt;Addition to Scot's comment, I guess your coworker has other codes running without testing your LSP.&lt;/P&gt;&lt;P&gt;Probably &lt;FONT color="#ff0000"&gt;(= ds nil)&lt;/FONT&gt; is a false statement on his end.&lt;/P&gt;&lt;P&gt;If this is the case, replace this&lt;/P&gt;&lt;PRE&gt;(if (= ds nil)
    (setq ds 999)
)&lt;/PRE&gt;&lt;P&gt;with this&lt;/P&gt;&lt;PRE&gt;(setq ds 999)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 23:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169023#M943245</guid>
      <dc:creator>BeKirra</dc:creator>
      <dc:date>2018-07-31T23:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169035#M943247</link>
      <description>&lt;P&gt;I have the lisp file attached in original message, if you see i also created a reset function which sets DS to nil. I use DS as a global variable to keep the duct size constant as elbows, more straight duct, and reducers are created. That's why i have an if statement where if ds does not equal 999 it starts off asking for pt2 rather than asking for the liner width,&amp;nbsp;sheet matal size, and initial start point... So i don't want to make ds 999 at the start of the function.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 23:44:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169035#M943247</guid>
      <dc:creator>MRummler</dc:creator>
      <dc:date>2018-07-31T23:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169074#M943252</link>
      <description>&lt;P&gt;Your rotine check if &lt;FONT color="#ff0000"&gt;ds = nil&lt;/FONT&gt; when start. It would be fine on your machine.&lt;/P&gt;&lt;P&gt;On your coworker's machine, it could be an issue if a value has already been&amp;nbsp;assigned&amp;nbsp;to&amp;nbsp;&lt;FONT color="#ff0000"&gt;ds&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 00:28:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169074#M943252</guid>
      <dc:creator>BeKirra</dc:creator>
      <dc:date>2018-08-01T00:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169079#M943253</link>
      <description>&lt;P&gt;Which is why i explained to him to use my reset command before starting new duct. It sets DS to nil.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the lisp so offset isn't in play, it is now working for him.&lt;/P&gt;&lt;P&gt;Thank you everybody for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 00:32:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8169079#M943253</guid>
      <dc:creator>MRummler</dc:creator>
      <dc:date>2018-08-01T00:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp Routine wont work on other computer.</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8174697#M943543</link>
      <description>I stumbled across an older program of mine and saw that&lt;BR /&gt;OFFSET can accept an entity (I said earlier that it expects a point).&lt;BR /&gt;Apologies for this.&lt;BR /&gt;&lt;BR /&gt;With that, change&lt;BR /&gt;(setq ss1 (ssget pt1))&lt;BR /&gt;to&lt;BR /&gt;(setq ss1 (entlast))&lt;BR /&gt;&lt;BR /&gt;2) If you are going to employ session Gremlins, assign a unique name&lt;BR /&gt;that virtually eliminates the possibility of another program overwriting.&lt;BR /&gt;'ds' is too easy to overwrite...&lt;BR /&gt;I personally name session Gremlins as "USER_" plus "ProgramName".&lt;BR /&gt;For your case: "USER_NewLineDuct".&lt;BR /&gt;&lt;BR /&gt;???&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Aug 2018 22:38:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/lisp-routine-wont-work-on-other-computer/m-p/8174697#M943543</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2018-08-02T22:38:31Z</dc:date>
    </item>
  </channel>
</rss>

