<?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 Betreff: AutoCAD Variable Setting Rejected in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955581#M85605</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;that's ok not knowing about VBA as I don't know LISP &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to bash (bash being the optimum word here) a piece of lisp which outputs the list to disk.&amp;nbsp; From there my VBA can pick it up and I'm in the process of writing something to process it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2019 13:52:20 GMT</pubDate>
    <dc:creator>dbrblg</dc:creator>
    <dc:date>2019-08-08T13:52:20Z</dc:date>
    <item>
      <title>AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8954906#M85598</link>
      <description>&lt;P&gt;I'm trying to do this in VBA/LISP:&lt;/P&gt;&lt;PRE&gt;ThisDrawing.SendCommand "(setvar " &amp;amp; """test""" &amp;amp; "(c:wd_proj_wdp_data)) "&lt;/PRE&gt;&lt;P&gt;In the command window, I get this following error:&lt;/P&gt;&lt;PRE&gt;Command: (setvar "test"(c:wd_proj_wdp_data)) ; error: AutoCAD variable setting rejected: "test" &lt;/PRE&gt;&lt;P&gt;Initially was using the users1 variable and I had the same error.&amp;nbsp; I thought the error might have been users1 not liking something that was returned (something incompatible with a string????) so changed it and still had the same issue!!&lt;/P&gt;&lt;P&gt;What is the issue here?&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 08:20:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8954906#M85598</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2019-08-08T08:20:54Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8954970#M85599</link>
      <description>&lt;P&gt;Before trying to control commands in autocad by automation, first test it by hand, step by step.&lt;/P&gt;
&lt;P&gt;The issue is: There isn't a variable named "TEST".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Command: SETVAR&lt;BR /&gt;Enter variable name or [?]: ?&lt;/P&gt;
&lt;P&gt;Enter variable(s) to list &amp;lt;*&amp;gt;: TES*&lt;/P&gt;
&lt;P&gt;No matching variables found.&lt;BR /&gt;Command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;USERS would work, but think about, it isn't saved in the system and not in the file.&lt;/P&gt;
&lt;P&gt;Command: (setvar "USERS3" "(c:wd_proj_wdp_data)")&lt;BR /&gt;"(c:wd_proj_wdp_data)"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check:&lt;/P&gt;
&lt;P&gt;Command: users3&lt;/P&gt;
&lt;P&gt;Enter new value for USERS3, or . for none &amp;lt;"(c:wd_proj_wdp_data)"&amp;gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don-ät know WHY do you try to save the string "(c:wd_proj_wdp_data)"&lt;/P&gt;
&lt;P&gt;and where should the variable/value are reachabler?&lt;/P&gt;
&lt;P&gt;Per file, saved or just for the file session?&lt;/P&gt;
&lt;P&gt;Per program, saved or just for the session?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 08:46:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8954970#M85599</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2019-08-08T08:46:30Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955027#M85600</link>
      <description>&lt;P&gt;At the start I used USERS1 but when I got the error I tried some alternative variables to see how they differed and whether I got the same errors.&amp;nbsp; This way I could at least see whether the variable itself was at fault or what I was trying to dowith it!!&amp;nbsp; Clearly variable TEST didn't work, but I got the same error as USERS1 which does exist...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My initial test was:&lt;/P&gt;&lt;PRE&gt;(setvar "users1"(c:wd_proj_wdp_data))&lt;/PRE&gt;&lt;P&gt;and not:&lt;/P&gt;&lt;PRE&gt;(setvar "USERS3" "(c:wd_proj_wdp_data)")&lt;/PRE&gt;&lt;P&gt;wd_proj_wdp_data is a LISP function for AutoCAD Electrical:&lt;/P&gt;&lt;PRE&gt;AutoLISP
 (c:wd_proj_wdp_data)
Returns
List of lists (rtrn): 
(nth 0 rtrn) = wdp file name. 
(nth 1 rtrn) = count of dwgs in file. 
(nth 2 rtrn) = list of *[ ] TITLE lines (start at (nth 1)). 
(nth 3 rtrn) = list of ?[ ] values. 
(nth 4 rtrn) = list of +[ ] values. 
(nth 5 rtrn) = list of drawing names (absolute paths). 
(nth 6 rtrn) = list of dwg names (absolute paths) with sec/subsec data included. 
(nth 7 rtrn) = list of drawing names (absolute paths) with "Ref only" removed. 
(nth 8 rtrn) = internal use. 
(nth 9 rtrn) = same as (nth 5 rtrn) but forced upper case. 
(nth 10 rtrn) = sorted list of all the drawings in the project together with its subfolder data.
Description
Read active project's WDP file.

&lt;/PRE&gt;&lt;P&gt;So im not trying to store the text (c:wd_proj_wdp_data) in to USERS1 but the value this function returns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only need per session store as I don't need it to persist across documents.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 09:13:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955027#M85600</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2019-08-08T09:13:58Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955055#M85601</link>
      <description>&lt;P&gt;&amp;gt;"So im not trying to store the text (c:wd_proj_wdp_data) in to USERS1 but the value this function returns."&lt;BR /&gt;Ok! But users1-5 ist for STRINGs only, if it would work, you would save the list as string and not as list.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;gt;"I only need per session store as I don't need it to persist across documents."&lt;BR /&gt;Let's take a look:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(c:wd_proj_wdp_data)&lt;BR /&gt;We don't know the definition of comamnd/function c:wd_proj_wdp_data,&lt;BR /&gt;so normaly we can not help, or?&lt;/P&gt;
&lt;P&gt;_&lt;/P&gt;
&lt;P&gt;Returns&lt;BR /&gt;List of lists (rtrn):&lt;/P&gt;
&lt;P&gt;If i am right (crystal ball ON)&lt;/P&gt;
&lt;P&gt;You start command wd_proj_wdp_data and after this, the result is bind to symbol RTRN. Is it right?&lt;BR /&gt;In other words: After you starts command wd_proj_wdp_data, the result is reachable by !RTRN, right?&lt;/P&gt;
&lt;P&gt;Then.. it is quite simple:&lt;BR /&gt;(setq RTRN1 RTRN)&lt;BR /&gt;Now, the data is availbe by (nth n RTRN1)&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 09:32:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955055#M85601</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2019-08-08T09:32:19Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955132#M85602</link>
      <description>&lt;P&gt;If I were to be doing this in LISP, I would do:&lt;/P&gt;&lt;PRE&gt;(setq x (c:wd_proj_wdp_data))&lt;/PRE&gt;&lt;P&gt;the lists of returned data is then available from x.&amp;nbsp; That I am ok with...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the reason for me to try and assign to a user variable, is that I want to be able to access this from VBA.&amp;nbsp; So, for example, I was trying to use this:&lt;/P&gt;&lt;PRE&gt;Function ProjectDetailsTest()
    ThisDrawing.SendCommand "(setvar " &amp;amp; """users1""" &amp;amp; "(c:wd_proj_wdp_data)) "
&lt;BR /&gt;    Dim s As String
    s = ThisDrawing.GetVariable("users3")
    Debug.Print s

End Function&lt;/PRE&gt;&lt;P&gt;The final goal is to retrieve data from LISP via VBA.&amp;nbsp; This is not an ideal way of doing it however I don't believe there is another easier way???&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue with using my LISP example, I listed above is that I don't believe x is retrievable via VBA!!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 10:16:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955132#M85602</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2019-08-08T10:16:16Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955262#M85603</link>
      <description>&lt;P&gt;You can store the information&lt;/P&gt;
&lt;P&gt;- in external files or your registry&lt;/P&gt;
&lt;P&gt;- as information on an object as extendet data or&lt;/P&gt;
&lt;P&gt;- perhaps your own dictionary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want to read LispVariables "directly" from VBA you have to load the VisualLisp library,&lt;/P&gt;
&lt;P&gt;but the next Problem is: VBA doesn't know what a LIST is. This objecttype is not available in VBA and in this case&lt;/P&gt;
&lt;P&gt;it can't work&lt;/P&gt;
&lt;P&gt;Possible to read the value from LispVariable "Test" via VisualLispTLB:&lt;/P&gt;
&lt;P&gt;(setq Test "MyString") yes&lt;/P&gt;
&lt;P&gt;(setq Test 44.0) yes&lt;/P&gt;
&lt;P&gt;(setq Test '("MyFavs" 2 3 4 '(cools))) =&amp;gt; CRASH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you want to go this way, you have to save your RTRN Information in another structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I Prefer to write/read an external ASCII File, ini xml - simple Ascii&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 11:50:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955262#M85603</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2019-08-08T11:50:00Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955571#M85604</link>
      <description>&lt;P&gt;I know nothing about VBA, but was wondering if he can convert the list to an array that VBA would understand.&lt;/P&gt;
&lt;P&gt;Also, if he wants the data available per session then he could use the bulletin board... vl-bb-set and vl-bb-ref.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 13:48:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955571#M85604</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2019-08-08T13:48:33Z</dc:date>
    </item>
    <item>
      <title>Betreff: AutoCAD Variable Setting Rejected</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955581#M85605</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;that's ok not knowing about VBA as I don't know LISP &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to bash (bash being the optimum word here) a piece of lisp which outputs the list to disk.&amp;nbsp; From there my VBA can pick it up and I'm in the process of writing something to process it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 13:52:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autocad-variable-setting-rejected/m-p/8955581#M85605</guid>
      <dc:creator>dbrblg</dc:creator>
      <dc:date>2019-08-08T13:52:20Z</dc:date>
    </item>
  </channel>
</rss>

