<?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: LISP to fill custom drawing properties from textfile in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956948#M48958</link>
    <description>&lt;P&gt;Thnx, works like it should!!! I'm sorry I didn't understand your question in the first place, as English is not my native language.&lt;/P&gt;&lt;P&gt;Why would it be better to have the texts in the template already, instead of the LISP filling them?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 16:05:33 GMT</pubDate>
    <dc:creator>geraldbossink</dc:creator>
    <dc:date>2022-02-17T16:05:33Z</dc:date>
    <item>
      <title>LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956068#M48950</link>
      <description>&lt;P&gt;I'm looking for a LISP that reads a txt-file in the same directory as the drawing. In the txt-file are two lines with text. First line is the client name, second line is the project name. In the drawing properties I want them filled in in the Custom Tab (as shown in the attached image). Is there some kind of LISP available for this?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 09:46:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956068#M48950</guid>
      <dc:creator>geraldbossink</dc:creator>
      <dc:date>2022-02-17T09:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956144#M48951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10334631"&gt;@geraldbossink&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm looking for a LISP that reads a txt-file in the same directory as the drawing. In the txt-file are two lines with text. First line is the client name, second line is the project name. In the drawing properties I want them filled in in the Custom Tab ..&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The name of the text file is the same as the drawing name with a .TXT extension?&lt;/P&gt;
&lt;P&gt;The Custom Opdrachtgever and Project already exists or sometimes not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:demo ( / aDoc DwgProps availableData source inc opf)
  
(setq aDoc     (vla-Get-ActiveDocument (vlax-Get-Acad-Object))
      DwgProps (vla-Get-SummaryInfo aDoc)
)
  (if (and
	(findfile
	  (setq Source (Strcat (getvar 'dwgprefix) "projectgegevens.txt")))
	  (repeat (setq inc (vla-numcustominfo DwgProps))
		  (vla-GetCustomByIndex DwgProps (setq inc (1- inc)) 'key 'value)
		  (setq availableData (cons (list key value inc) availableData))
		  )
          (Vl-every '(lambda (cn)
		       (assoc cn availableData))
		    (setq CustomNames '("Opdrachtgever" "Project")))
	)
    (progn
      (setq opf (open Source "r"))
      (foreach itm CustomNames
       (setq a (read-line opf))
		(vla-SetCustomByKey DwgProps itm a)
	)
      (close opf)
      )
    )(princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 13:48:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956144#M48951</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2022-02-17T13:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956373#M48952</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;: The dir will contain multiple drawings, so the txt-file will have a general name, let's say 'projectgegevens'. The idea is:&lt;/P&gt;&lt;P&gt;1. txt-file is created&lt;/P&gt;&lt;P&gt;2. new drawing is created, LISP runs and fills the custom properties&lt;/P&gt;&lt;P&gt;3. Drawing header contails fields for client and project, that are automatically filled when the custom properties are filled&lt;/P&gt;&lt;P&gt;4. When adding a new layout to the drawing, a new header is inserted and automatically filled.&lt;/P&gt;&lt;P&gt;At the start of the project the txt-file is created, so for every new drawing the txt-file exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 12:14:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956373#M48952</guid>
      <dc:creator>geraldbossink</dc:creator>
      <dc:date>2022-02-17T12:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956569#M48953</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10334631"&gt;@geraldbossink&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The dir will contain multiple drawings, so the txt-file will have a general name, let's say 'projectgegevens'.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Updated the code at post # 2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Hope that helps&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 13:49:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956569#M48953</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2022-02-17T13:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956688#M48954</link>
      <description>&lt;P&gt;I'm sorry to inform you, but it doesn't. Saved the code as LISP and ran it, but custom drawing properties remain empty. I tried adding/prefixing 'opdrachtgever' en 'project' in de txt-file, but that didn't work either. Changed 'defun c:demo' to 'defun c:pg', without the requested result.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 14:48:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956688#M48954</guid>
      <dc:creator>geraldbossink</dc:creator>
      <dc:date>2022-02-17T14:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956703#M48955</link>
      <description>&lt;P&gt;This is key&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(setq CustomNames '("Opdrachtgever" "Project")))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;If those names does not match the custom property on your drawing the program will not continue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a go with that and let me know&lt;/P&gt;
&lt;P&gt;Otherwise attached your drawing here&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 14:53:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956703#M48955</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2022-02-17T14:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956781#M48956</link>
      <description>&lt;P&gt;Hmmm... Yes, that works. But now I have to fill in "opdrachtgever' and 'project' in the custom properties or have these standard in my template. Isn't it possible to make the LISP do that?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 15:16:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956781#M48956</guid>
      <dc:creator>geraldbossink</dc:creator>
      <dc:date>2022-02-17T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956897#M48957</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10334631"&gt;@geraldbossink&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hmmm... Yes, that works. But now I have to fill in "opdrachtgever' and 'project' in the custom properties or have these standard in my template. Isn't it possible to make the LISP do that?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;That was my question early on.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;e Custom Opdrachtgever and Project already exists or sometimes not?&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Better have those on the template files&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;Or&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun c:demo (/ aDoc DwgProps availableData source inc opf data)
  (setq	aDoc	 (vla-Get-ActiveDocument (vlax-Get-Acad-Object))
	DwgProps (vla-Get-SummaryInfo aDoc)
  )
  (if
    (findfile
      (setq Source (Strcat (getvar 'dwgprefix) "projectgegevens.txt"))
    )
     (progn
       (setq opf (open Source "r"))
       (While (setq a (read-line opf))
	 (if (/= a "")
	   (setq data (cons a data))
	 )
       )
       (close opf)

       (repeat (setq inc (vla-numcustominfo DwgProps))
	 (vla-GetCustomByIndex
	   DwgProps
	   (setq inc (1- inc))
	   'key
	   'value
	 )
	 (setq availableData (cons (list key value inc) availableData))
       )

       (mapcar '(lambda	(a b)
		  (if (assoc a availableData)
		    (vla-SetCustomByKey DwgProps a b)
		    (vla-AddCustomInfo DwgProps a b)
		  )
		)
	       '("Opdrachtgever" "Project") (reverse data)
       )
       (vlax-release-object DwgProps)
     )
  )
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 15:50:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956897#M48957</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2022-02-17T15:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956948#M48958</link>
      <description>&lt;P&gt;Thnx, works like it should!!! I'm sorry I didn't understand your question in the first place, as English is not my native language.&lt;/P&gt;&lt;P&gt;Why would it be better to have the texts in the template already, instead of the LISP filling them?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 16:05:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956948#M48958</guid>
      <dc:creator>geraldbossink</dc:creator>
      <dc:date>2022-02-17T16:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956986#M48959</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;FONT size="3"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10334631"&gt;@geraldbossink&lt;/a&gt;&amp;nbsp;wrote:&lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Thnx, works like it should!!!&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Good to know it helps.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;FONT size="3"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10334631"&gt;@geraldbossink&lt;/a&gt;&amp;nbsp;wrote:&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Why would it be better to have the texts in the template already, instead of the LISP filling them?&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;It's just good practice really&amp;nbsp; IMO &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Cheers&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10334631"&gt;@geraldbossink&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 16:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/10956986#M48959</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2022-02-17T16:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/12934432#M48960</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;Hi Patrick. Thank you it works for me. what if two text file. One file for Custom Names and the other for values. The CAD file has no custom properties yet. Thank you!!! hope you can help&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 22:10:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/12934432#M48960</guid>
      <dc:creator>Cudal</dc:creator>
      <dc:date>2024-08-01T22:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to fill custom drawing properties from textfile</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/12935627#M48961</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15685952"&gt;@Cudal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...what if two text file. One file for Custom Names and the other for values. The CAD file has no custom properties yet. Thank you!!! hope you can help&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;That can be arranged&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15685952"&gt;@Cudal&lt;/a&gt;&lt;BR /&gt;&lt;/FONT&gt;can you check if this works on you AutoCAD&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(setq sourceFolder( acet-ui-pickdir "Select Value source fodler" (getvar 'dwgprefix)))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;Copy and paste that on the command line&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2024 05:30:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-fill-custom-drawing-properties-from-textfile/m-p/12935627#M48961</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2024-08-04T05:30:10Z</dc:date>
    </item>
  </channel>
</rss>

