<?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: How to Populte DCL boxes With Values From a Text File in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10052440#M65668</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for all your help.&amp;nbsp; I did finally figure it out.&lt;/P&gt;&lt;P&gt;I created a dialog box that asked if they want to populate from a previously run attempt and for the drawing number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program now creates a text file in the form Attribute:Value and uses the values from the dialog box to print to the file.&amp;nbsp; If they ran the program already, then the file is created and they can use it to populate the dialog then next time.&lt;/P&gt;&lt;P&gt;If they choose to preload, then it goes to a function that loops through the text file and sets all the actual variables to the values from the text file.&amp;nbsp;&amp;nbsp;(if (= attributeName "BODY_X") (setq unitLength attributeValue))&lt;/P&gt;&lt;P&gt;Then before the "action_tiles" I have commands like&amp;nbsp;(set_tile "bodyX" unitLength), so the tile gets set to the string value from the text file.&lt;/P&gt;&lt;P&gt;The part that made it all work was in the "action_tile accept" line.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(action_tile "accept"
  (strcat "(progn (setq pkgGroupVal (get_tile \"pkgGrp_pop\"))"
          "(setq unitLength (atof (get_tile \"bodyX\")))"
          "(setq unitWidth (atof (get_tile \"bodyY\")))"
            :
            :
          "(done_dialog 1))"
  )
 )&lt;/LI-CODE&gt;&lt;P&gt;That sets the values for the variables.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 23:05:32 GMT</pubDate>
    <dc:creator>mgorecki</dc:creator>
    <dc:date>2021-02-02T23:05:32Z</dc:date>
    <item>
      <title>How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9986147#M65660</link>
      <description>&lt;P&gt;I have a dialog box with a&amp;nbsp;lot of boxes to fill in.&amp;nbsp; I want to be able to populate the boxes (tiles) with the values saved from a previously run attempt.&lt;/P&gt;&lt;P&gt;The program currently creates a text file that stores the values, based on the drawing number.&lt;/P&gt;&lt;P&gt;The program currently can read the file based on the drawing number that was entered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a button on the dialog box called "Load Previous" that runs a function that reads the text file and puts the values into the tiles.&amp;nbsp; I might not be doing that correctly.&lt;/P&gt;&lt;P&gt;This is the text in the DCL file:&lt;/P&gt;&lt;P&gt;: button {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;key = "loadPrevious";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;label = "Load Previous";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;action = "(LoadPreviousCAI)";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;The function determines the attribute name and the attribute value from the text file, then it's supposed to put that value into the tile.&lt;/P&gt;&lt;P&gt;(if (= attributeName "BODY_X") (set_tile "bodyX" attributeValue))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate any help on this, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 01:11:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9986147#M65660</guid>
      <dc:creator>mgorecki</dc:creator>
      <dc:date>2021-01-08T01:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9986358#M65661</link>
      <description>&lt;P&gt;If you make a list 1st of keys and attrib-values then on start up if NIL do load-keys function behind the scenes 1st. If you have already ran the dcl but want to use the data file, you would click your button to force a read of the file more than likely you may need to unload the dcl and reload so it now reads the current list of values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 04:39:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9986358#M65661</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-08T04:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9986808#M65662</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/70249"&gt;@mgorecki&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;maybe this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(if (= attributeName "BODY_X") (set_tile "LoadPrevious" attributeValue))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;moshe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 09:40:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9986808#M65662</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2021-01-08T09:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9987675#M65663</link>
      <description>&lt;P&gt;Thank you for that info, but unfortunately I'm not sure how to do that.&amp;nbsp; The way the program will be used, the user will run it&amp;nbsp; and hopefully they get the desired results, if not, they'll want to run it again, but then they have to re-enter all the info again.&amp;nbsp; They would like a way to have the DCL automatically fill in with their previous values and just change the ones that needed changing.&lt;/P&gt;&lt;P&gt;If the button method was used, and I unloaded and loaded the DCL again, how would the program populate the fields after the DCL is reloaded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 15:30:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9987675#M65663</guid>
      <dc:creator>mgorecki</dc:creator>
      <dc:date>2021-01-08T15:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9988750#M65664</link>
      <description>&lt;P&gt;I do this all the time rembering values and putting them in correct tile&amp;nbsp;&lt;/P&gt;&lt;P&gt;step 1 if all varaibles nil set to default values ie read your file make say ((keyX value)..........&lt;/P&gt;&lt;P&gt;step2 do a foreach and set key value&lt;/P&gt;&lt;P&gt;step3 update the list ((keyx value).............&lt;/P&gt;&lt;P&gt;step4 on exit update txt file you can have a custom button Ok, OK_Cancel, OK_Cancel_Dofileexit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me its page 166 of my R12 Autocad Customization manual making your own "Exit Button"&amp;nbsp; old paper copies come in handy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ok_dotofile : column {
: row {
fixed_width true ;
alignment = centered ;
dotofile_button ;
: spacer { width = 2 ;}
ok_button ;
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is not tested you can check for button dotofile when&amp;nbsp;&amp;nbsp;(action_tile "dotofile"&amp;nbsp; OK is "accept" will try to put together an example.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 22:53:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9988750#M65664</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-08T22:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9999420#M65665</link>
      <description>&lt;P&gt;My function works in that it reads the text file, then populates the dialog box.&amp;nbsp; The problem is, after picking the "OK" button, it goes on to execute the code, but no values have been saved.&amp;nbsp; The program then crashes the first time it needs a value.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 19:23:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/9999420#M65665</guid>
      <dc:creator>mgorecki</dc:creator>
      <dc:date>2021-01-13T19:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10000039#M65666</link>
      <description>&lt;P&gt;You need an option "Resave file " thats waht I was suggesting with a custom button this could call a defun that rewrites the data file.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 01:24:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10000039#M65666</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-14T01:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10002746#M65667</link>
      <description>&lt;P&gt;You need to post code and dcl so people can look at it.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 23:03:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10002746#M65667</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-01-14T23:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10052440#M65668</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for all your help.&amp;nbsp; I did finally figure it out.&lt;/P&gt;&lt;P&gt;I created a dialog box that asked if they want to populate from a previously run attempt and for the drawing number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program now creates a text file in the form Attribute:Value and uses the values from the dialog box to print to the file.&amp;nbsp; If they ran the program already, then the file is created and they can use it to populate the dialog then next time.&lt;/P&gt;&lt;P&gt;If they choose to preload, then it goes to a function that loops through the text file and sets all the actual variables to the values from the text file.&amp;nbsp;&amp;nbsp;(if (= attributeName "BODY_X") (setq unitLength attributeValue))&lt;/P&gt;&lt;P&gt;Then before the "action_tiles" I have commands like&amp;nbsp;(set_tile "bodyX" unitLength), so the tile gets set to the string value from the text file.&lt;/P&gt;&lt;P&gt;The part that made it all work was in the "action_tile accept" line.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(action_tile "accept"
  (strcat "(progn (setq pkgGroupVal (get_tile \"pkgGrp_pop\"))"
          "(setq unitLength (atof (get_tile \"bodyX\")))"
          "(setq unitWidth (atof (get_tile \"bodyY\")))"
            :
            :
          "(done_dialog 1))"
  )
 )&lt;/LI-CODE&gt;&lt;P&gt;That sets the values for the variables.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 23:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10052440#M65668</guid>
      <dc:creator>mgorecki</dc:creator>
      <dc:date>2021-02-02T23:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to Populte DCL boxes With Values From a Text File</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10052532#M65669</link>
      <description>&lt;P&gt;You should not need the progn, good to hear its working.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 23:54:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-populte-dcl-boxes-with-values-from-a-text-file/m-p/10052532#M65669</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-02-02T23:54:12Z</dc:date>
    </item>
  </channel>
</rss>

