<?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 for text increment. in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387269#M114721</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture12.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/402424i65CD47A1399B782A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture12.PNG" alt="Capture12.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;THIS ONE SIR... (sz. should be no.)&lt;/P&gt;</description>
    <pubDate>Mon, 18 Sep 2017 11:16:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-09-18T11:16:12Z</dc:date>
    <item>
      <title>Lisp for text increment.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7386837#M114718</link>
      <description>&lt;P&gt;I HAVE A SET OF MLEADERS WITH USER BLOCK WITH ATTRIBUTES. I SOMETIMES MISS AN OBJECT THRU TAGGING WHICH I NEED TO ADJUST AGAIN ALL THE NUMBER BY ONE. IS THERE ANY LISP THAT WILL AUTOMATICALLY ADJUST MY NUMBER BY +1 ON ALL THE SAME MLEADER AT THE SAME-TIME. +1(INCREMENT).&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 07:12:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7386837#M114718</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-18T07:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for text increment.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387139#M114719</link>
      <description>&lt;P&gt;Should be fairly easily to code.&lt;/P&gt;&lt;P&gt;Can you post an example drawing with the block as we need to know the attribute tag containing the number.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 09:55:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387139#M114719</guid>
      <dc:creator>DannyNL</dc:creator>
      <dc:date>2017-09-18T09:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for text increment.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387212#M114720</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;easy and dirty but should works for you.&lt;/P&gt;
&lt;P&gt;Run it&amp;nbsp;with TRY in cmd - you can change it if you want to.&lt;/P&gt;
&lt;P&gt;Lisp was written by LeeMac, I've just modified a little his test part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;;---------=={ Set MLeader Block Attribute Value }==----------;;
;;                                                            ;;
;;  Sets the value of the specified tag for the specified     ;;
;;  MLeader                                                   ;;
;;------------------------------------------------------------;;
;;  Author: Lee McDonnell, 2010                               ;;
;;                                                            ;;
;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  mleader - ename/VLA-Object MLeader with attributed block  ;;
;;  tag     - Tagstring of the attribute to change            ;;
;;  value   - Value to which attribute will be set            ;;
;;------------------------------------------------------------;;
;;  Returns:  T if successful, else nil                       ;;
;;------------------------------------------------------------;;

(defun LM:SetMLeaderBlockAttributeValue ( mleader tag value / def id )
  (vl-load-com)
  ;; © Lee Mac 2010

  (if
    (and
      (eq "AcDbMLeader"
        (vla-get-Objectname
          (setq mleader
            (cond
              ( (eq 'VLA-OBJECT (type mleader)) mleader)
              ( (vlax-ename-&amp;gt;vla-object mleader) )
            )
          )
        )
      )
      (= 1 (vla-get-ContentType mleader))
      (setq def
        (LM:Itemp
          (vla-get-Blocks
            (vla-get-ActiveDocument
              (vlax-get-acad-object)
            )
          )
          (vla-get-ContentBlockName mleader)
        )
      )
    )
    (if
      (progn
        (vlax-for obj def
          (if (and (eq "AcDbAttributeDefinition" (vla-get-Objectname obj))
                   (eq (strcase tag) (strcase (vla-get-TagString obj))))
            (setq id (vla-get-ObjectID obj))
          )
        )
        id
      )
      (not (vla-SetBlockAttributeValue mleader id value))
    )
  )
)

;;-----------------------=={ Itemp }==------------------------;;
;;                                                            ;;
;;  Retrieves the item with index 'item' if present in the    ;;
;;  specified collection, else nil                            ;;
;;------------------------------------------------------------;;
;;  Author: Lee McDonnell, 2010                               ;;
;;                                                            ;;
;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  coll - the VLA Collection Object                          ;;
;;  item - the index of the item to be retrieved              ;;
;;------------------------------------------------------------;;
;;  Returns:  the VLA Object at the specified index, else nil ;;
;;------------------------------------------------------------;;

(defun LM:Itemp ( coll item )
  ;; © Lee Mac 2010
  (if
    (not
      (vl-catch-all-error-p
        (setq item
          (vl-catch-all-apply
            (function vla-item) (list coll item)
          )
        )
      )
    )
    item
  )
)
;;;

(defun c:Try (/ i e); change command here
  (setq i 0)				; enter start number here instead of 0
  (while (setq e (car (entsel "\nSelect MLeader: ")))
    (LM:SetMLeaderBlockAttributeValue e "TAG" (rtos i 2 0));put TAG name which you want to modify here instead of "TAG"
    (setq i (+ 1 i))			;put increment you want here instead of 1
  )
)&lt;/PRE&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 10:35:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387212#M114720</guid>
      <dc:creator>krzysztof.psujek</dc:creator>
      <dc:date>2017-09-18T10:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for text increment.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387269#M114721</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture12.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/402424i65CD47A1399B782A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture12.PNG" alt="Capture12.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;THIS ONE SIR... (sz. should be no.)&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 11:16:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387269#M114721</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-18T11:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for text increment.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387275#M114722</link>
      <description>&lt;P&gt;This one works perfect, should be reloaded every number where i start.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot sir. good for my revision as they are adding more valves in drawings. nearly thousand hehehe.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 11:04:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7387275#M114722</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-18T11:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp for text increment.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7843889#M114723</link>
      <description>&lt;PRE&gt;(setq i 0)				; enter start number here instead of 0&lt;/PRE&gt;&lt;P&gt;can we set the "0" as a reference value for increment? by selecting/picking&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 06:42:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-text-increment/m-p/7843889#M114723</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-11T06:42:44Z</dc:date>
    </item>
  </channel>
</rss>

