<?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: AutoLISP Startup Routine Debugging Help Request in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239519#M117535</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555" target="_self"&gt;Ranjit.Singh&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!!! It Works Great just as I wanted!&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Coreymbarge&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2017 17:44:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-19T17:44:49Z</dc:date>
    <item>
      <title>AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7238727#M117529</link>
      <description>&lt;P&gt;I am setting up machines in my office with an ACADDOC.LSP AutoLISP Routine to load custom LISP routines to do the following on startup:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;Initialize the drawing environment routine:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;(command ".setvar" "expert" 1)&lt;/P&gt;&lt;P&gt;(command ".viewres" "y" "5000")&lt;/P&gt;&lt;P&gt;&amp;nbsp;(command ".color" "BYLAYER")&lt;/P&gt;&lt;P&gt;&amp;nbsp;(command ".linetype" "set" "BYLAYER") &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.Redefine the Qsave command in “Stealth Mode” to automatically purge all blocks from the drawing every drawing session:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(command ".undefine" "QSAVE")&lt;/P&gt;&lt;P&gt;(defun c:qsave ()&lt;/P&gt;&lt;P&gt;&amp;nbsp;(setvar "cmdecho" 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;(command "-purge" "b" "*" "n")&lt;/P&gt;&lt;P&gt;&amp;nbsp; (command ".qsave")&lt;/P&gt;&lt;P&gt;&amp;nbsp; (setvar "cmdecho" 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; (princ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.Undefine Qleader command with dialog box message to user to “Use Mleader Command!” to enforce CAD standards:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(command ".undefine" "QLEADER")&lt;/P&gt;&lt;P&gt;(defun C:QLEADER ()&lt;/P&gt;&lt;P&gt;&amp;nbsp; (command ".qleader")&lt;/P&gt;&lt;P&gt;&amp;nbsp; (alert "Use Mleader Command!")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (princ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is the custom LISP routines fail to load due code errors I can’t seem to figure out!&lt;/P&gt;&lt;P&gt;I get the following history message after startup:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Opening an AutoCAD 2007/LT 2007 format file.&lt;/P&gt;&lt;P&gt;Regenerating model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.setvar expert 1 .viewres y 5000 .-color BYLAYER ; error: misplaced dot on input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AutoCAD menu utilities loaded..setvar expert 1 .viewres y 5000 .color BYLAYER .linetype set BYLAYER .undefine&lt;/P&gt;&lt;P&gt;Invalid option keyword.&lt;/P&gt;&lt;P&gt;; error: Function cancelled&lt;/P&gt;&lt;P&gt;*Cancel*&lt;/P&gt;&lt;P&gt;*Cancel*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to writing AutoLISP routines. Can anyone please help me debug the above code?&lt;/P&gt;&lt;P&gt;I have attached .LISP files.&lt;/P&gt;&lt;P&gt;All help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Corey Barge&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:00:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7238727#M117529</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T14:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7238998#M117530</link>
      <description>&lt;P&gt;Not sure, but i think you're missing a "" at&amp;nbsp;&amp;nbsp;(command ".linetype" "set" "BYLAYER" &lt;STRONG&gt;""&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try setvar instead&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setvar 'CECOLOR "BYLAYER")
(setvar 'CELTYPE "BYLAYER")&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:10:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7238998#M117530</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2017-07-19T15:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239235#M117531</link>
      <description>&lt;P&gt;Any &lt;STRONG&gt;command &lt;/STRONG&gt;calls cannot be made &lt;EM&gt;reliably&lt;/EM&gt; from acaddoc.lsp unless you use &lt;STRONG&gt;defun-q &lt;/STRONG&gt;to define&amp;nbsp;a startup function. As a result you get the error for &lt;STRONG&gt;undefine&lt;/STRONG&gt; command. Also it's a good practice to add any AutoCAD environment settings to &lt;STRONG&gt;acad.lsp&lt;/STRONG&gt; since you don't need to call the environment settings for every document.&amp;nbsp;Typically &lt;STRONG&gt;acaddoc.lsp&amp;nbsp;&lt;/STRONG&gt;makes &lt;STRONG&gt;load &lt;/STRONG&gt;calls only and not defines custom functions. If you start defining custom functions in acaddoc then your file we grow tremendously and maybe difficult to manage at some point.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;will add&amp;nbsp;the following&amp;nbsp;in acad.lsp&lt;/P&gt;
&lt;PRE&gt;(setvar 'expert 1)
(setvar 'cecolor "bylayer")
(setvar 'celtype "bylayer")
&lt;/PRE&gt;
&lt;P&gt;The acaddoc should now call your lsp file &lt;STRONG&gt;(load "mylisps.lsp")&lt;/STRONG&gt; which defines any custom functions. Make sure the mylisps.lsp file is added to a trusted location path. Or alternatively add the file location path&amp;nbsp;to your trusted locations.&amp;nbsp;I made mylisps.lsp with following&lt;/P&gt;
&lt;PRE&gt;(command ".viewres" "y" "5000")&lt;BR /&gt;(command "._undefine" "QSAVE")
(command "._undefine" "QLEADER")
(defun c:qsave ()
 (setvar "cmdecho" 0)
 (command "-purge" "b" "*" "n")
  (command "._qsave")
  (setvar "cmdecho" 1)
  (princ)
 )
(defun C:QLEADER ()
  (command "._qleader")
  (alert "Use Mleader Command!")
(princ)
 )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Now when you open your AutoCAD application, acad.lsp will set all your environment settings and anytime you open a dwg file acaddoc will make your custom functions available in&amp;nbsp;that document.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="acaddoc.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/379702iD429301A5A35BEBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="acaddoc.gif" alt="acaddoc.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:17:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239235#M117531</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-07-19T16:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239291#M117532</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555"&gt;@Ranjit_Singh&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;Any &lt;STRONG&gt;command &lt;/STRONG&gt;calls cannot be made &lt;EM&gt;reliably&lt;/EM&gt; from acaddoc.lsp unless you .....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;......will set all your environment settings and anytime you open a dwg file acaddoc will make&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Wow, Wish I posted a reply as thorough as you did. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: What program do you use to generate the attached GIF ? That file format is just right to show what one meant without going through a lengthy discussion, normally i posts a video from Autodesk screencast.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:38:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239291#M117532</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2017-07-19T16:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239345#M117533</link>
      <description>&lt;P&gt;There are many free utilities out there.&amp;nbsp;Just google "screen recording". We decided to invest a little in &lt;A href="https://www.flashbackrecorder.com/fbhome/" target="_blank"&gt;https://www.flashbackrecorder.com/fbhome/&lt;/A&gt; since we have offshore offices&amp;nbsp;and its a lot faster to explain them with screen recordings. Personal choice as well (I am a man of few words &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:57:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239345#M117533</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-07-19T16:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239353#M117534</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555"&gt;@Ranjit_Singh&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;.... We decided to invest a little in &lt;A href="https://www.flashbackrecorder.com/fbhome/" target="_blank"&gt;https://www.flashbackrecorder.com/fbhome/&lt;/A&gt; since we have offshore offices&amp;nbsp;and its a lot faster to explain them with screen recordings. ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank you, I will look into this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pBe&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:01:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239353#M117534</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2017-07-19T17:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239519#M117535</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555" target="_self"&gt;Ranjit.Singh&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!!! It Works Great just as I wanted!&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Coreymbarge&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:44:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239519#M117535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T17:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239538#M117536</link>
      <description>&lt;P&gt;HTH.&amp;nbsp;You will also find &lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/AutoCAD-Customization/files/GUID-FDB4038D-1620-4A56-8824-D37729D42520-htm.html" target="_blank"&gt;this&lt;/A&gt; AutoCAD&amp;nbsp;Knowledgebase article&amp;nbsp;very helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:50:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239538#M117536</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-07-19T17:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239582#M117537</link>
      <description>&lt;P&gt;How do you&amp;nbsp;&lt;SPAN&gt;add the file location path&amp;nbsp;to your trusted locations?&amp;nbsp;&lt;img id="smileyembarrassed" class="emoticon emoticon-smileyembarrassed" src="https://forums.autodesk.com/i/smilies/16x16_smiley-embarrassed.png" alt="Smiley Embarassed" title="Smiley Embarassed" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Coreymbarge&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:57:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239582#M117537</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T17:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239636#M117538</link>
      <description>&lt;P&gt;You can set it in your options dialog box. Type &lt;STRONG&gt;OPTIONS&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="trusted_locations.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/379788i30BC275946A417E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="trusted_locations.png" alt="trusted_locations.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 18:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239636#M117538</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-07-19T18:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239762#M117539</link>
      <description>&lt;P&gt;Never mind. I found it in the "Options" "files tab.&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coreymbarge&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 18:47:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239762#M117539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T18:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Startup Routine Debugging Help Request</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239765#M117540</link>
      <description>&lt;P&gt;Thanks for all the screen shots! They Really help!&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 18:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-startup-routine-debugging-help-request/m-p/7239765#M117540</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T18:48:52Z</dc:date>
    </item>
  </channel>
</rss>

