Jump to content

custom attribute numbering lisp


Recommended Posts

hopefully you can read the red text on the picture as it explains what i'm looking for...if not, let me know and I'll type it out again. thank you 





Link to comment
Share on other sites

1 hour ago, ReMark said:

Red text against a black background is never easy to read.


Edited by ronjonp
Link to comment
Share on other sites

Here is an example note layout names include "Model" it numbers based on layout order as this can be different to just get layout names. Use the (vla-get-count tabs) for the number of layouts - 1.


(defun c:1rev ( / len doc lay plotabs newstr tabname oldtagn ss1 att x y)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq tabs (vla-get-Layouts doc))
(setq y 0)
(setq bname "DA1DRTXT")
(setq oldtagn "REV_NO")
(setq newstr (-(getint "Please enter version for sheets..") 1))
(repeat (vla-get-count tabs)
(vlax-for lay tabs
(setq x (vla-get-taborder lay))
(setq tabname (vla-get-name lay))
(if (and (= y x) (/= tabname "Model"))
      (setvar "ctab" tabname)
      (setq ss1 (ssget "x"  (list (cons 0 "INSERT") (cons 2 bname)(cons 410 tabname))))
      (foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 0 )) 'getattributes)
        (if (= oldtagn (strcase (vla-get-tagstring att)))
           (vla-put-textstring att (rtos (setq newstr (+ newstr 1)) 2 0))
(setq y (+ y 1))




Edited by BIGAL
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...