<?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: Linking a FIELD to a Block Count in AutoCAD for Mac Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/10356016#M25640</link>
    <description>&lt;P&gt;Hi Yael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AutoCAD 2022 now has this feature built-in, you should look into it!&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 17:07:35 GMT</pubDate>
    <dc:creator>prousseauCQJ6U</dc:creator>
    <dc:date>2021-06-01T17:07:35Z</dc:date>
    <item>
      <title>Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6409772#M25608</link>
      <description>&lt;P&gt;Is it possible to display an autoupdating block count by using a FIELD in a TABLE? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked but I can't seem to find the information, any input is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 03:50:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6409772#M25608</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-06-29T03:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6409830#M25609</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;There is no direct way in plain AutoCAD and especially in AutoCAD for Mac. If you have full AutoCAD version (not LT) you can use workaround with small AitoLISP routine and DIESEL expression in the Field.&lt;BR /&gt;&lt;BR /&gt;Are you using AutoCAD LT?&lt;BR /&gt;If so, than it seems to be impossible to accomplish this task, even with workaround I mentioned above.&lt;BR /&gt;&lt;BR /&gt;Maxim</description>
      <pubDate>Wed, 29 Jun 2016 05:21:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6409830#M25609</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-06-29T05:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6411362#M25610</link>
      <description>&lt;P&gt;Hi Maxim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm on the full version. &amp;nbsp;Would the routine&amp;nbsp;go in the &lt;STRONG&gt;Field Expression&lt;/STRONG&gt;&amp;nbsp;box area of the FIELD command popup?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My experience is very limited with coding. &amp;nbsp;What is the difference between DIESEL and AutoLISP and which would be better in this scenario?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 18:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6411362#M25610</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-06-29T18:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6411439#M25611</link>
      <description>You cannot use AutoLISP expressions in fields, but you can use DIESEL expressions.&lt;BR /&gt;The idea is to assign a number of occurrences of the block to variable and show the value of this variable in the FIELD using DIESEL expression.&lt;BR /&gt;&lt;BR /&gt;Look at this discussion:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.theswamp.org/index.php?topic=15926.0" target="_blank"&gt;https://www.theswamp.org/index.php?topic=15926.0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here is another discussion:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.arch-pub.com/DIESEL-Expression-to-return-occurances-of-blocks_10221422.html" target="_blank"&gt;http://www.arch-pub.com/DIESEL-Expression-to-return-occurances-of-blocks_10221422.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Maxim</description>
      <pubDate>Wed, 29 Jun 2016 19:35:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6411439#M25611</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-06-29T19:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6411957#M25612</link>
      <description>&lt;P&gt;Hi Maxim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for directing me to these resources, they appear to do exactly what I need. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I am a total newbie to AutoLISP and was unable to get Mark's routine over at &lt;STRONG&gt;theswamp.org&lt;/STRONG&gt; you referenced &lt;A href="https://www.theswamp.org/index.php?topic=15926.0" target="_blank"&gt;here&lt;/A&gt;&amp;nbsp;to work. &amp;nbsp;I'll repost my edited version and hopefully you wouldn't mind pointing out where I went wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Retracing my steps:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Modified the code to count multiple blocks and saved as BLOCK_COUNT.lsp, here's my modified version (I renamed the test blocks 1 2 and 3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:recount (/ block_list cnt env_name)&lt;BR /&gt;&lt;BR /&gt;(setq block_list&lt;BR /&gt; (list&lt;BR /&gt; (cons '2 "1")&lt;BR /&gt; (cons '2 "2")&lt;BR /&gt; (cons '2 "3")&lt;BR /&gt; )&lt;BR /&gt; )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; (foreach i block_list&lt;BR /&gt; (if&lt;BR /&gt; (setq ss (ssget "X" (list '(0 . "INSERT") i)))&lt;BR /&gt; (progn&lt;BR /&gt; (setq &lt;BR /&gt; cnt (itoa (sslength ss))&lt;BR /&gt; env_name (strcat "BLOCK_COUNT_" (cdr i)) &lt;BR /&gt; )&lt;BR /&gt; (setenv env_name cnt)&lt;BR /&gt; (princ (strcat "\nSet " env_name " to " cnt))&lt;BR /&gt; )&lt;BR /&gt; )&lt;BR /&gt; )&lt;BR /&gt; (princ)&lt;BR /&gt; )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) used the APPLOAD command to load the routine named BLOCK_COUNT.lsp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) inserted three fields into my drawing using the DieselExpression type with the following expressions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(getenv, BLOCK_COUNT_1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(getenv, BLOCK_COUNT_2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(getenv, BLOCK_COUNT_3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) ran the command UPDATEFIELD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and nothing happened. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated &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;</description>
      <pubDate>Thu, 30 Jun 2016 03:21:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6411957#M25612</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-06-30T03:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6412030#M25613</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything works fine on my side. Verify that the blocks in your drawing have the names "1", "2" and "3", as the routine counts blocks only with these names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just added one line to the AutoLISP routine (REGEN command) in order to refresh fields values within the routine, so you don't need to use&amp;nbsp;&lt;SPAN&gt;UPDATEFIELD command for each field after recounting blocks.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:recount (/ block_list cnt env_name)

(setq block_list
 (list
 (cons '2 "1")
 (cons '2 "2")
 (cons '2 "3")
 )
 )


 (foreach i block_list
 (if
 (setq ss (ssget "X" (list '(0 . "INSERT") i)))
 (progn
 (setq 
 cnt (itoa (sslength ss))
 env_name (strcat "BLOCK_COUNT_" (cdr i)) 
 )
 (setenv env_name cnt)
 (princ (strcat "\nSet " env_name " to " cnt))
 )
 )
 )
 (command "_REGEN") ;_refreshes field values
 (princ)
 )&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Maxim&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 05:23:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6412030#M25613</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-06-30T05:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6414092#M25614</link>
      <description>&lt;P&gt;Hi Maxim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your updated routine and attempted to update the FIELDs again but I still cannot get a number output. &amp;nbsp;I only see "- - - -" in the FIELD, both when I insert it and after updating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you using the routine in AutoCAD for Mac?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 01:57:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6414092#M25614</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-01T01:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6414194#M25615</link>
      <description>Yes, it works in AutoCAD for Mac - I have tested it in 2016 version.&lt;BR /&gt;Can you attach here the drawing file (with blocks and inserted fields) where you tested this routine? &lt;BR /&gt;&lt;BR /&gt;Maxim</description>
      <pubDate>Fri, 01 Jul 2016 04:20:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6414194#M25615</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-07-01T04:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6415736#M25616</link>
      <description>&lt;P&gt;Sure, see attached.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 20:06:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6415736#M25616</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-01T20:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6415785#M25617</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;at the command prompt type:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;(setenv "BLOCK_COUNT_1" "10")&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;than hit Return.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now&amp;nbsp;type:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;(getenv "BLOCK_COUNT_1")&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;and hit Return.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output in the command window should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Command: (setenv "BLOCK_COUNT_1" "10")
"10"
Command: (getenv "BLOCK_COUNT_1")
"10"
Command:&lt;/PRE&gt;
&lt;P&gt;What do you see on your side?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maxim&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 20:46:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6415785#M25617</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-07-01T20:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420161#M25618</link>
      <description>&lt;P&gt;Yes, I see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: (setenv "BLOCK_COUNT_1" "10")&lt;BR /&gt;"10"&lt;BR /&gt;Command: (getenv "BLOCK_COUNT_1")&lt;BR /&gt;"10"&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 19:12:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420161#M25618</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-05T19:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420271#M25619</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Than I cannot understand why fields on your side are not updated.&lt;/P&gt;
&lt;P&gt;As I wrote before, on my side everything works in your drawing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;div class="video-embed-center video-embed"&gt;&lt;iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FziMCgM7mK8Y%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DziMCgM7mK8Y&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FziMCgM7mK8Y%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" width="600" height="338" scrolling="no" title="recount" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture;" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Double check DIESEL expressions in the fields:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/252882iB6C8FD234A8F6422/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="2016-07-05_23-11-02.png" title="2016-07-05_23-11-02.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maxim&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 20:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420271#M25619</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-07-05T20:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420558#M25620</link>
      <description>&lt;P&gt;Thanks for the video, when I type RECOUNT the FIELDs do indeed update correctly. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was using the commands UPDATEFIELD and REGEN, why wouldn't these commands also update the count? &amp;nbsp;Should I update my FIELDEVAL setting (currently at 31)?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 00:10:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420558#M25620</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-06T00:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420652#M25621</link>
      <description>RECOUNT calls AutoLISP routine which calculates block instances, keeps the number of the blocks in the AutoCAD preferences file (environment variables) and then updates the fields according to the calculations.&lt;BR /&gt;REGEN and UPDATEFIELD knows nothing about the blocks in the drawing, so the cannot change fields according to the number of blocks.&lt;BR /&gt;When you load AutoLISP routine, it doesn't run immediately, you need to call it with RECOUNT  command each time you need to recalculate the number of blocks.&lt;BR /&gt;&lt;BR /&gt;Maxim</description>
      <pubDate>Wed, 06 Jul 2016 03:19:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6420652#M25621</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-07-06T03:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6421759#M25622</link>
      <description>&lt;P&gt;Thanks for clarifying, this little nugget of code will make my&amp;nbsp;workflow quite a bit smoother.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you Maxim for all your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 15:54:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6421759#M25622</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-06T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6422702#M25623</link>
      <description>&lt;P&gt;Hi Maxim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question, is there any way to modify the routine to show "0" if no blocks of a particular name are found? &amp;nbsp;Currently if you erase all of say block 3 and RECOUNT, the FIELD will show the previous count total instead of updating to "0".&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 00:15:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6422702#M25623</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-07T00:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6422966#M25624</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:recount (/ block_list cnt env_name)
(setq block_list
(list
(cons '2 "1")
(cons '2 "2")
(cons '2 "3")
)
)
(foreach i block_list
(if
(setq ss (ssget "X" (list '(0 . "INSERT") i)))

(progn
(setq
cnt (itoa (sslength ss))
env_name (strcat "BLOCK_COUNT_" (cdr i))
)
(setenv env_name cnt)
(princ (strcat "\nSet " env_name " to " cnt))
)

(progn
(setq
cnt "0"
env_name (strcat "BLOCK_COUNT_" (cdr i))
)
(setenv env_name cnt)
(princ (strcat "\nSet " env_name " to " cnt))
)

)
)
(command "_REGEN") ;_refreshes field values
(princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maxim&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 05:35:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6422966#M25624</guid>
      <dc:creator>maxim_k</dc:creator>
      <dc:date>2016-07-07T05:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6424382#M25625</link>
      <description>&lt;P&gt;Works like a charm. &amp;nbsp;I can't thank you enough Maxim, cheers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 19:09:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/6424382#M25625</guid>
      <dc:creator>seedstudiolandscapedesign</dc:creator>
      <dc:date>2016-07-07T19:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/7732840#M25627</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;maxim_k!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to count the blocks through an attribute called LUM, how can I do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have the blocks like this:&lt;/P&gt;&lt;P&gt;Name: 03.6572.40 (The manufacturer code, FLOS in this case)&lt;BR /&gt;Attribute "LUM": I rename the field with L1, L2, L3...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 17:36:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/7732840#M25627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-29T17:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Linking a FIELD to a Block Count</title>
      <link>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/8712018#M25628</link>
      <description>&lt;P&gt;Use data extraction method to update block count&lt;/P&gt;
&lt;P&gt;after updating blocks update data table&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2791733"&gt;@seedstudiolandscapedesign&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is it possible to display an autoupdating block count by using a FIELD in a TABLE? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've looked but I can't seem to find the information, any input is appreciated.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2019 13:03:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-for-mac-forum/linking-a-field-to-a-block-count/m-p/8712018#M25628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-06T13:03:42Z</dc:date>
    </item>
  </channel>
</rss>

