Jump to content
jetxcc

custom attribute numbering lisp

Recommended Posts

jetxcc

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 

 

 

1296704404_LAYOUTLISPNUMBER.thumb.png.9992f6e059cd3a3cf821405e515ac452.png

 

Share this post


Link to post
Share on other sites
ReMark

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

Share this post


Link to post
Share on other sites
ronjonp
1 hour ago, ReMark said:

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

image.thumb.png.407386b9ea3afff0c57fc22e5c9531d4.png:) 

Edited by ronjonp

Share this post


Link to post
Share on other sites
BIGAL

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"))
(progn
      (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))
)
)
(c:1rev)

 

 

 

Edited by BIGAL

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...