<?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: I need to edit a LISP to automatically number multiple blocks in the same sequence in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12889786#M11978</link>
    <description>&lt;P&gt;and more...&lt;/P&gt;&lt;P&gt;the door blocks are not always inserted at rotation 0, so if you insert one at 90 degrees, the tag must be rotate to be at readable angle also the tag may&amp;nbsp;&lt;SPAN&gt;interfere with other graphic elements like annotations which require you to move the tag.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the best way to deal with door\windows tags is to create separate blocks tag for each type. this let you move/rotate doors and tags freely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sounds logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&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>Wed, 10 Jul 2024 18:25:16 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2024-07-10T18:25:16Z</dc:date>
    <item>
      <title>I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886066#M11967</link>
      <description>&lt;P&gt;I have used one of Lee Macs autonumbering attribute programs however, I need to have the program involve 6 attributes to number all of them together sequentially rather than just one attribute at a time. This is for a door block I made and my aim is that they are all involved in the same numbering sequence when in a floor plan.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can help me find a way to do so that would be amazing&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 10:17:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886066#M11967</guid>
      <dc:creator>MaxandrewsHZ3UD</dc:creator>
      <dc:date>2024-07-09T10:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886243#M11968</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15643203"&gt;@MaxandrewsHZ3UD&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the attached lisp work with your blocks?&lt;/P&gt;&lt;P&gt;Post a sample dwg with your doors after&amp;nbsp;&lt;SPAN&gt;involving 6 attributes to a number&amp;nbsp;so we understand what you are requesting.&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>Tue, 09 Jul 2024 10:33:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886243#M11968</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-07-09T10:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886266#M11969</link>
      <description>&lt;P&gt;Yeah the lisps work with the current set of blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am planning to make 3 double door versions of each door type with imperial measurements and would like them all to continue the number count no matter what door type it is, rather than having 6 sequences.&amp;nbsp; Currently they have a sperate lisp to allow them to function separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the response!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 10:54:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886266#M11969</guid>
      <dc:creator>MaxandrewsHZ3UD</dc:creator>
      <dc:date>2024-07-09T10:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886367#M11970</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15643203"&gt;@MaxandrewsHZ3UD&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry i still do not understand&lt;/P&gt;&lt;P&gt;I opened your dwg, load the lisp, drag a door from blocks palette (INSERT command) and noting happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the normal way that such a program works is one by one (to increment by 1 the next insert)&lt;/P&gt;&lt;P&gt;what you want is to tag all blocks in one shoot?&lt;/P&gt;&lt;P&gt;do you mind the order?&lt;/P&gt;&lt;P&gt;how do you expect the lisp will know the order?&lt;/P&gt;&lt;P&gt;do each door type have a different number sequence?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&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>Tue, 09 Jul 2024 11:55:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886367#M11970</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-07-09T11:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886625#M11971</link>
      <description>Sorry if I'm being confusing, I just wanted to see if there was a possibility to have all the blocks be in the same number sequence and still go up by 1 each time. So upon insertion, despite the block, they +1 after the last block was inserted. I just need an automatic count for all the doors rather than a separate count for each type of door block.</description>
      <pubDate>Tue, 09 Jul 2024 13:25:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886625#M11971</guid>
      <dc:creator>MaxandrewsHZ3UD</dc:creator>
      <dc:date>2024-07-09T13:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886679#M11972</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15643203"&gt;@MaxandrewsHZ3UD&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;well...&lt;/P&gt;&lt;P&gt;Lee's program won't help you here cause it works with one specific block\tag name and you have 3 single door types and you are planning to add double door types?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so i am thinking on another solution - stay tune&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&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>Tue, 09 Jul 2024 13:47:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886679#M11972</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-07-09T13:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886768#M11973</link>
      <description>Yeah I still have yet to add more door types.&lt;BR /&gt;&lt;BR /&gt;Thank you! super excited &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;</description>
      <pubDate>Tue, 09 Jul 2024 14:17:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12886768#M11973</guid>
      <dc:creator>MaxandrewsHZ3UD</dc:creator>
      <dc:date>2024-07-09T14:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12888158#M11974</link>
      <description>&lt;P&gt;One way may be to insert 1st block and fill in the attributes doortype doorwidth doorht doornum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then select that block and insert the same block but an interim step is that you have found all door blocks with that name and found last number. Then re-fill in the attributes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way you can have multiple blocks single and double doors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last comment can have a dynamic block with visibility states so one block has all door styles, but with the 4 attributes. Google for block.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 05:27:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12888158#M11974</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-07-10T05:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12888178#M11975</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15643203"&gt;@MaxandrewsHZ3UD&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After more exploring the issue last night i came to&amp;nbsp;&lt;SPAN&gt;conclusion that we have to define some rules to agree on&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;since we have 3 types doors (and in future we will have more doors and maybe windows)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;each door type tag have a prefix of 'D' character&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;concrete door type will start numerating with 10&amp;nbsp; =&amp;gt; (D10, D11, D12....)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Timber door type will start numerating with 20&amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; (D20, D21, D22 ....)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Metal door type will start numerating with 30&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt;&amp;nbsp; (D30, D31, D32...)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;future types will take 40, 50, 60 ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and windows will have 'W' prefix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but this numeration limits you only to 10 doors to a type in a project.&lt;/P&gt;&lt;P&gt;if this not enough? we will have to add 1 more digit as D101, D102....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what do you think?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&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;&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>Wed, 10 Jul 2024 05:46:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12888178#M11975</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-07-10T05:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12888512#M11976</link>
      <description>That would be great to have the prefix changeable, and I can always change the attribute tag so it is same in both a window block and door block so it makes referencing easier&lt;BR /&gt;&lt;BR /&gt;The aim I had was to find out if there was a way to get all the door types to go up by:&lt;BR /&gt;&lt;BR /&gt;D01, D02, D03, D04, ..., D10, D11 etc.&lt;BR /&gt;&lt;BR /&gt;and count the total amount of doors in the drawing rather than a set number range for each door type.</description>
      <pubDate>Wed, 10 Jul 2024 08:52:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12888512#M11976</guid>
      <dc:creator>MaxandrewsHZ3UD</dc:creator>
      <dc:date>2024-07-10T08:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12889593#M11977</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15643203"&gt;@MaxandrewsHZ3UD&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i think you are wrong,&amp;nbsp;&lt;SPAN&gt;eventually you'll end up with my conclusion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the fact each type has it own scope, does not limit you to count the total amount.&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;</description>
      <pubDate>Wed, 10 Jul 2024 16:48:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12889593#M11977</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-07-10T16:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12889786#M11978</link>
      <description>&lt;P&gt;and more...&lt;/P&gt;&lt;P&gt;the door blocks are not always inserted at rotation 0, so if you insert one at 90 degrees, the tag must be rotate to be at readable angle also the tag may&amp;nbsp;&lt;SPAN&gt;interfere with other graphic elements like annotations which require you to move the tag.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the best way to deal with door\windows tags is to create separate blocks tag for each type. this let you move/rotate doors and tags freely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sounds logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&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>Wed, 10 Jul 2024 18:25:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12889786#M11978</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-07-10T18:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: I need to edit a LISP to automatically number multiple blocks in the same sequence</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12890722#M11979</link>
      <description>&lt;P&gt;Just a side comment I have played with this task and produce quantity of doors by type size color etc, it allows counting by up to 5 attributes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg&lt;/P&gt;&lt;P&gt;Black Goldhandle 24&lt;/P&gt;&lt;P&gt;Silver Blackhandle 34&lt;/P&gt;&lt;P&gt;Silver Silverhandle 12&lt;/P&gt;&lt;P&gt;Not free but small cost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on your Drawing 1 if you get a selection set = 18 objects, you can check,&amp;nbsp;EffectiveName (RO) = "Timber Stud_Imperial Door_Single" then look at attribute DREF and get highest value, the example dwg is a bad one as the last door should be D18, option 1 is renumber all doors, starting at X, option 2 is number last door +1 highest which is what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a start get highest door number, so long as "Effectivename" contains "Door" in its name. Change a couple of the door numbers I made last door D18 for testing.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test ( / blk blkname bname ss x val dnum)

;;-------------------=={ Parse Numbers }==--------------------;;
;;                                                            ;;
;;  Parses a list of numerical values from a supplied string. ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  s - String to process                                     ;;
;;------------------------------------------------------------;;
;;  Returns:  List of numerical values found in string.       ;;
;;------------------------------------------------------------;;

(defun LM:ParseNumbers ( s )
  (
    (lambda ( l )
      (read
        (strcat "("
          (vl-list-&amp;gt;string
            (mapcar
              (function
                (lambda ( a b c )
                  (if
                    (or
                      (&amp;lt; 47 b 58)
                      (and (= 45 b) (&amp;lt; 47 c 58) (not (&amp;lt; 47 a 58)))
                      (and (= 46 b) (&amp;lt; 47 a 58) (&amp;lt; 47 c 58))
                    )
                    b 32
                  )
                )
              )
              (cons nil l) l (append (cdr l) (list nil))
            )
          )
          ")"
        )
      )
    )
    (vl-string-&amp;gt;list s)
  )
)

(prompt "select door blocks. ")
(setq ss (ssget '((0 . "INSERT"))))

(if (= ss nil)
(progn (alert "You have not selected any blocks \nWill now exit \nPlease check dwg ")(exit))
)

(setq dnum 0)
(repeat (setq x (sslength ss))
 (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss (setq x (- x 1)))))
 (setq bname (vlax-get obj 'effectivename))
 (if (wcmatch bname "*Door*")
 (progn
  (setq atts (vlax-invoke obj 'Getattributes))
  (foreach att atts
   (setq tag (vlax-get att 'tagstring))
   (if (= tag "DREF")
   (progn
    (setq val (car (LM:ParseNumbers (vlax-get att 'textstring))))
    (princ (strcat (rtos val 2 0) "\n"))
    (if (&amp;gt; val dnum)(setq dnum val))
   )
   )
  )
 )
 )
)

(princ (strcat "\nHighest door number is " (rtos dnum 2 0)))

(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;What needs to be considered is best way to approach task just insert windows and later number, it will be by creation order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is something I have.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SeaHaven_0-1720677119363.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1385451iABE11ACC483742D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_0-1720677119363.png" alt="SeaHaven_0-1720677119363.png" /&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, 11 Jul 2024 05:53:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/i-need-to-edit-a-lisp-to-automatically-number-multiple-blocks-in/m-p/12890722#M11979</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-07-11T05:53:09Z</dc:date>
    </item>
  </channel>
</rss>

