Automatic Current sheet numbering in the Block , AutoLIPS

Automatic Current sheet numbering in the Block , AutoLIPS

khairulbasharcivil06
Participant Participant
1,562 Views
10 Replies
Message 1 of 11

Automatic Current sheet numbering in the Block , AutoLIPS

khairulbasharcivil06
Participant
Participant

Dear All, Below coding  of auto lisp shows the sheet number and current sheet number at command tab but I need it written in all sheets with current position serially and automatic change in case of sheet position change. 

 

 

(defun c:tabpage ( / lst ord )

(vl-load-com)

(vlax-for lay (vla-get-layouts
(vla-get-activedocument (vlax-get-acad-object))
)
(setq
lst
(cons (cons (vla-get-name lay) (itoa (vla-get-taborder lay)))
lst
)
)
)

(foreach x lst

(if
(= (car x) (getvar 'ctab))
(setq ord (cdr x))
)
)

(alert (strcat "The TABORDER of the Current Layout [ "
(getvar 'ctab)
" ] is: "
ord
" "
)
)

(princ)

)

0 Likes
Accepted solutions (2)
1,563 Views
10 Replies
Replies (10)
Message 2 of 11

paullimapa
Mentor
Mentor
Accepted solution

If you have an Attribute where you want this to be written to then same as solution in this thread 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/auto-renaming-page-number-in-layouts...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 11

paullimapa
Mentor
Mentor
Accepted solution

FYI, here's a modified version of TabNumber.lsp that allows you to select the Attribute instead of embedding the Block & Tag names:

; TabNumber function performs the following:
; When run 1st time prompts for Attribute selection,
; its Tag & Block name will be used to
; collect all matching Blocks in the current drawing,
; cycle through all [Layouts] with [Model tab ignored]
; where Blocks are placed and input the following 
; 2 fields onto the found matching Attribute:
; First field is layout order # and 
; Second field is total # of Layouts
; Fields are used so they will automatically update when Layouts are added or deleted
; as well as when Layouts are moved to a different sequence order
; For example:
; When matching Block Attribute is found the following info will be placed:
; 3 OF 4 
; 3 Field represents the Layout is 3rd in order sequence
; 4 Field represents total number of Layouts
; Note: Fieldeval is set to 31 so a save, regen or plot will update the field value
; When run thereafter TabNumber will use Attribute & Block info from object selected on first run
; Use TabNumberClr function 
; to clear the first time Attribute & Block selection so a new Attribute selection can be made
; Programmed in response to:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/auto-renaming-page-number-in-layouts/td-p/11689335/jump-to/first-unread-message
; Modified from:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-auto-page-number-layout-tabs/m-p/10199097#M413381
(princ"\nLoading Function...")(princ)
(defun c:tabnumber (/ _lay2fld _put ctab en ed fld s tabnam) ; aec_blk_name aec_tag_name
  (vl-load-com)
  (alert"Running TabNumber on Blocks Found in Layouts\nBlocks Found in Model are Ignored")
  (setvar"fieldeval"31)
; _lay2fld function returns field values of current layout order & total number of layouts
; modified from lay2fld
; https://forums.augi.com/showthread.php?170740-Getting-the-number-of-a-layout-tab
 (defun _lay2fld (/ doc lay ids id1 id2)
  ;;------------------------------------;;
  ;; Tharwat - Date: 03.Dec.2017	;;
  ;;------------------------------------;;
  ; ids function gets given object ids
  (defun ids (obj doc / uty)
    (if (vlax-method-applicable-p
          (setq uty (vla-get-utility doc))
          'getobjectidstring
        )
      (vla-getobjectidstring uty obj :vlax-false)
      (itoa (vla-get-objectid obj))
    )
  ) ; defun ids
       (setq doc (vla-get-activedocument (vlax-get-acad-object)) ; get current dwg obj
             lay (vla-get-layouts doc)                   ; get all Layouts
             id1 (ids (vla-item lay (getvar 'ctab)) doc) ; get current Layout object id 
             id2 (ids lay doc)                           ; get total Layout object id
       )
      ; setup the two Field strings
       (strcat
           "%<\\AcObjProp Object(%<\\_ObjId " id1 ">%).TabOrder>%"
           " OF " "%<\\AcExpr %<\\AcObjProp Object(%<\\_ObjId " id2
           ">%).Count>%-1 >%"
       )
  ) ; defun _lay2fld
 ; _put function collects given Block's Attributes & finds matching Tag to place Fields value
  (defun _put (blk tag val)
    ; when found matching Attribute Tag name replace with Field string value
    (vl-some
       '(lambda (x) (and (equal (vla-get-tagstring x) (strcase tag)) (vla-put-textstring x val)))
      (vlax-invoke blk 'getattributes) ; get all Attributes within Block returns as a list
    )
  ) ; defun _put
  (setq	
        ctab (getvar"ctab") ; save current Layout
;; No longer implementing following:
;; Edit below to match with Block name and Attribute Tag name 
;        aec_blk_name "TITLE_BLOCK_INFORMATION_NEW_OCT 19-2010" ; "YOURTITLEBLOCKNAME"
;        aec_tag_name "SHEET#" ; "YOURATTRIBUTETAG"
  )
;; Implement Select Attribute:
 (while (not aec_blk_name)
  (setq aec_blk_name (nentsel"\nSelect Attribute Tag To Enter Page Number Fields:" ))
  (if (not (equal "ATTRIB" (cdr(assoc 0(setq ed(entget(setq en(car aec_blk_name))))))))
   (progn                                  ; then did not select Attribute
    (setq aec_blk_name nil)
    (princ"\nObject Selected is Not an Attribute...")(princ)
   )
   (progn                                  ; else Attribute selected
    (setq aec_tag_name (cdr(assoc 2 ed)))           ; get & set global Attribute Tag name
    (setq aec_blk_name (cdr(assoc 2 (entget(cdr(assoc 330 ed)))))) ; get & set global Block name
   )
  ) ; if
 ) ; while
  (if (setq s (ssget "_A" (list '(0 . "INSERT") (cons 2 aec_blk_name) '(66 . 1)))) ; get all matching Blocks
    (foreach b (mapcar 'cadr (ssnamex s))  ; create list of all entities from selection set & cycle through
      (if 
       (and 
        (setq tabnam(cdr (assoc 410 (entget b)))) ; get Layout name where Block is placed
        (/= tabnam "Model") ; ignore Block if placed in Model
       )
       (progn
        (setvar "ctab" tabnam) ; make Layout current
        (setq fld (_lay2fld))  ; get Field value
        (_put (vlax-ename->vla-object b) aec_tag_name fld) ; place Field value into Attribute
       ) ; progn
      ) ; if
    ) ; then loop
    (alert
     (strcat"No Matching Blocks Named:\n\t[" 
            aec_blk_name 
            "]\nWith Attribute Tag Named:\n\t["
            aec_tag_name
            "]\nFound in Current Drawing."
     )
    ) ; else alert
  ) ; if Blocks found
  (if(equal (getvar"ctab") ctab) ; chk if last Layout in loop matches with original
   (command"_.Regen") ; then regen to update Fields
   (setvar"ctab"ctab) ; else return to original Layout 
  ) ; if
  (alert"TabNumber Completed Successfully")
  (princ)
) ; defun TabNumber
; TabNumberClr function
(defun c:tabnumberclr ()
 (setq aec_blk_name nil) ; clear global Block name
 (princ"\nTABNUMBER Successfully Cleared.")(princ)
 (c:tabnumber) ; run TabNumber function
); defun TabNumberClr
(princ"\n...Loaded Successfully...Enter Command:\n\t[TABNUMBER] to Execute.\n\t[TABNUMBERCLR] to Reselect.")(princ)

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 11

khairulbasharcivil06
Participant
Participant

Thanks Paulli Apa, It is working nicely . If I  want to reduce 1 or 2 from current sheet number means count ignoring first 1 or 2 sheet, is it possible? 

0 Likes
Message 5 of 11

paullimapa
Mentor
Mentor

this modified Tabnumber.lsp version will give you the option to enter number to reduce from total layout count.

if you need to reset this number, use TabnumberClr command:

 

; TabNumber function performs the following:
; When run 1st time prompts for Attribute selection,
; its Tag & Block name will be used to
; collect all matching Blocks in the current drawing,
; cycle through all [Layouts] with [Model tab ignored]
; where Blocks are placed and input the following 
; 2 fields onto the found matching Attribute:
; First field is layout order # and 
; Second field is total # of Layouts
; Fields are used so they will automatically update when Layouts are added or deleted
; as well as when Layouts are moved to a different sequence order
; For example:
; When matching Block Attribute is found the following info will be placed:
; 3 OF 4 
; 3 Field represents the Layout is 3rd in order sequence
; 4 Field represents total number of Layouts
; Note: Fieldeval is set to 31 so a save, regen or plot will update the field value
; When run thereafter TabNumber will use Attribute & Block info from object selected on first run
; Use TabNumberClr function 
; to clear the first time Attribute & Block selection so a new Attribute selection can be made
; Programmed in response to:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/auto-renaming-page-number-in-layouts/td-p/11689335/jump-to/first-unread-message
; and changed to pick Attribute in response to:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatic-current-sheet-numbering-in-the-block-autolips/td-p/11695206
; Modified from:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-auto-page-number-layout-tabs/m-p/10199097#M413381
(princ"\nLoading Function...")(princ)
(defun c:tabnumber (/ _lay2fld _put aec_chkblknam ctab en ed fld num s tabnam) ; aec_blk_name aec_tag_name aec_tabnum_tot
  (vl-load-com)
  (setvar"fieldeval"31)
; _lay2fld function returns field values of current layout order & total number of layouts
; modified from lay2fld
; Argument:
; n = number to reduce total layout count
; https://forums.augi.com/showthread.php?170740-Getting-the-number-of-a-layout-tab
 (defun _lay2fld ( n / doc lay ids id1 id2)
  ;;------------------------------------;;
  ;; Tharwat - Date: 03.Dec.2017	;;
  ;;------------------------------------;;
  ; ids function gets given object ids
  (defun ids (obj doc / uty)
    (if (vlax-method-applicable-p
          (setq uty (vla-get-utility doc))
          'getobjectidstring
        )
      (vla-getobjectidstring uty obj :vlax-false)
      (itoa (vla-get-objectid obj))
    )
  ) ; defun ids
       (setq doc (vla-get-activedocument (vlax-get-acad-object)) ; get current dwg obj
             lay (vla-get-layouts doc)                   ; get all Layouts
             id1 (ids (vla-item lay (getvar 'ctab)) doc) ; get current Layout object id 
             id2 (ids lay doc)                           ; get total Layout object id          
       )
      ; setup the two Field strings
       (strcat
           "%<\\AcObjProp Object(%<\\_ObjId " id1 ">%).TabOrder>%"
           " OF " "%<\\AcExpr %<\\AcObjProp Object(%<\\_ObjId " id2
           ">%).Count>%- " (itoa (1+ n)) ">%"
       )
  ) ; defun _lay2fld
; _put function collects given Block's Attributes & finds matching Tag to place Fields value
 (defun _put (blk tag val)
    ; when found matching Attribute Tag name replace with Field string value
    (vl-some
       '(lambda (x) (and (equal (vla-get-tagstring x) (strcase tag)) (vla-put-textstring x val)))
      (vlax-invoke blk 'getattributes) ; get all Attributes within Block returns as a list
    )
 ) ; defun _put
; aec_chkblknam function chks for dynamic block before returns block name
; Argument:
; ent-arg = entity object
; Returns:
; block name
 (defun aec_chkblknam (ent-arg / objv)
  (setq objv (VLAX-ENAME->VLA-OBJECT ent-arg)) ; convert entity to obj
  (if (= (VLAX-GET-PROPERTY objv 'IsDynamicBlock) :VLAX-TRUE) ; chk if dynamic block 
   (vlax-get-property objv 'EffectiveName) 
   (cdr (assoc 2 (entget ent-arg)))
  )
 ) ; defun 
;; No longer implementing following:
;; Edit below to match with Block name and Attribute Tag name 
;  (setq 
;        aec_blk_name "TITLE_BLOCK_INFORMATION_NEW_OCT 19-2010" ; "YOURTITLEBLOCKNAME"
;        aec_tag_name "SHEET#" ; "YOURATTRIBUTETAG"
;  ) ; setq
;; Implement Select Attribute:
 (while (not aec_blk_name)
  (setq aec_blk_name (nentsel"\nSelect Attribute Tag To Enter Page Number Fields:" ))
  (if 
   (or
    (not aec_blk_name)
    (not (equal "ATTRIB" (cdr(assoc 0(setq ed(entget(setq en(car aec_blk_name))))))))
   )
   (progn                                  ; then did not select Attribute
    (setq aec_blk_name nil)
    (princ"\nObject Selected is Not an Attribute...")(princ)
   )
   (progn
    (setq aec_tag_name (cdr(assoc 2 ed)))           ; get & set global Attribute Tag name
    (setq aec_blk_name (aec_chkblknam(cdr(assoc 330 ed)))) ; get & set global Block name including Dynamic
    ; # to reduce total layout tab count
    (if(not aec_tabnum_tot)(setq aec_tabnum_tot 0)) ; set global # to subtract from total Layout quantity
    (if (setq num(getint(strcat"\nEnter Number To Subtract from Total Layout Quantity: <"(itoa aec_tabnum_tot)">: ")))
     (setq aec_tabnum_tot (abs num))
    ) ; if
    (alert
     (strcat
      "Running TabNumber on Block Attributes Found in Layouts\n"
      "Subtracting Total Layout Quantity by: [" (itoa aec_tabnum_tot) "]\n"
      "Block Attributes Found in Model tab are Ignored."
     ) ; strcat
    ) ; alert
   ) ; progn
  ) ; if
 ) ; while
 (if aec_blk_name
   (progn                                  ; Attribute selected
    (setq	ctab (getvar"ctab")) ; save current Layout
    (if (setq s (ssget "_A" (list '(0 . "INSERT") (cons 2 (strcat aec_blk_name ",`*U*")) '(66 . 1)))) ; get all matching Blocks including Dynamic
     (progn
      (foreach b (mapcar 'cadr (ssnamex s))  ; create list of all entities from selection set & cycle through
       (if 
        (and 
         (= 'ename (type b)) ; confirm is entity
         (setq tabnam(cdr (assoc 410 (entget b)))) ; get Layout name where Block is placed
         (/= tabnam "Model") ; ignore Block if placed in Model
        )
        (progn
         (setvar "ctab" tabnam) ; make Layout current
         (setq fld (_lay2fld aec_tabnum_tot))  ; get Field value
         (_put (vlax-ename->vla-object b) aec_tag_name fld) ; place Field value into Attribute
        ) ; progn
       )  ; if
      ) ; then loop
      (if(equal (getvar"ctab") ctab) ; chk if last Layout in loop matches with original
       (command"_.Regen") ; then regen to update Fields
       (setvar"ctab"ctab) ; else return to original Layout 
      ) ; if
      (alert"TabNumber Completed Successfully.\nTo Reselect Another Run Command:\n[TabNumberClr]")
     ) ; progn
     (alert
      (strcat"No Matching Blocks Named:\n\t[" 
            aec_blk_name 
            "]\nWith Attribute Tag Named:\n\t["
            aec_tag_name
            "]\nFound in Current Drawing."
      )
     ) ; else alert
    ) ; if Blocks found
   ) ; progn Attrib selected
  ) ; if aec_blk_name
(princ)
) ; defun TabNumber
; TabNumberClr function
(defun c:tabnumberclr ()
 (setq aec_blk_name nil) ; clear global Block name
 (princ"\nTABNUMBER Successfully Cleared.")(princ)
 (c:tabnumber) ; run TabNumber function
); defun TabNumberClr
(princ"\n...Loaded Successfully...Enter Command:\n\t[TABNUMBER] to Execute.\n\t[TABNUMBERCLR] to Reselect.")(princ)

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 11

khairulbasharcivil06
Participant
Participant
Thanks for your kind reply. It is working for only total layout number reducing. But it will be helpful for me if it reduce from both current sheet number and total sheet number. I will graceful if you share it.
0 Likes
Message 7 of 11

paullimapa
Mentor
Mentor

not sure if this is the results you want but let's say you want to reduce by 3 because first 3 layouts out of 5 you don't have the Attribute and so you only want to start on layout #4 with 1 of 2 and #5 will show 2 of 2, then use this modifed code:

; TabNumber function performs the following:
; When run 1st time prompts for Attribute selection,
; its Tag & Block name will be used to
; collect all matching Blocks in the current drawing,
; cycle through all [Layouts] with [Model tab ignored]
; where Blocks are placed and input the following 
; 2 fields onto the found matching Attribute:
; First field is layout order # and 
; Second field is total # of Layouts
; Fields are used so they will automatically update when Layouts are added or deleted
; as well as when Layouts are moved to a different sequence order
; For example:
; When matching Block Attribute is found the following info will be placed:
; 3 OF 4 
; 3 Field represents the Layout is 3rd in order sequence
; 4 Field represents total number of Layouts
; Note: Fieldeval is set to 31 so a save, regen or plot will update the field value
; When run thereafter TabNumber will use Attribute & Block info from object selected on first run
; Use TabNumberClr function 
; to clear the first time Attribute & Block selection so a new Attribute selection can be made
; Programmed in response to:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/auto-renaming-page-number-in-layouts/td-p/11689335/jump-to/first-unread-message
; and changed to pick Attribute in response to:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automatic-current-sheet-numbering-in-the-block-autolips/td-p/11695206
; Modified from:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-auto-page-number-layout-tabs/m-p/10199097#M413381
(princ"\nLoading Function...")(princ)
(defun c:tabnumber (/ _lay2fld _put aec_chkblknam ctab en ed fld num s tabnam) ; aec_blk_name aec_tag_name aec_tabnum_tot
  (vl-load-com)
  (setvar"fieldeval"31)
; _lay2fld function returns field values of current layout order & total number of layouts
; modified from lay2fld
; Argument:
; n = number to reduce total layout count
; https://forums.augi.com/showthread.php?170740-Getting-the-number-of-a-layout-tab
 (defun _lay2fld ( n / doc lay ids id1 id2)
  ;;------------------------------------;;
  ;; Tharwat - Date: 03.Dec.2017	;;
  ;;------------------------------------;;
  ; ids function gets given object ids
  (defun ids (obj doc / uty)
    (if (vlax-method-applicable-p
          (setq uty (vla-get-utility doc))
          'getobjectidstring
        )
      (vla-getobjectidstring uty obj :vlax-false)
      (itoa (vla-get-objectid obj))
    )
  ) ; defun ids
       (setq doc (vla-get-activedocument (vlax-get-acad-object)) ; get current dwg obj
             lay (vla-get-layouts doc)                   ; get all Layouts
             id1 (ids (vla-item lay (getvar 'ctab)) doc) ; get current Layout object id 
             id2 (ids lay doc)                           ; get total Layout object id          
       )
      ; setup the two Field strings
       (strcat
;           "%<\\AcObjProp Object(%<\\_ObjId " id1 ">%).TabOrder>%"
           "%<\\AcExpr %<\\AcObjProp Object(%<\\_ObjId " id1
           ">%).TabOrder>%- " (itoa n) ">%"
           " OF " "%<\\AcExpr %<\\AcObjProp Object(%<\\_ObjId " id2
           ">%).Count>%- " (itoa (1+ n)) ">%"
       )
  ) ; defun _lay2fld
; _put function collects given Block's Attributes & finds matching Tag to place Fields value
 (defun _put (blk tag val)
    ; when found matching Attribute Tag name replace with Field string value
    (vl-some
       '(lambda (x) (and (equal (vla-get-tagstring x) (strcase tag)) (vla-put-textstring x val)))
      (vlax-invoke blk 'getattributes) ; get all Attributes within Block returns as a list
    )
 ) ; defun _put
; aec_chkblknam function chks for dynamic block before returns block name
; Argument:
; ent-arg = entity object
; Returns:
; block name
 (defun aec_chkblknam (ent-arg / objv)
  (setq objv (VLAX-ENAME->VLA-OBJECT ent-arg)) ; convert entity to obj
  (if (= (VLAX-GET-PROPERTY objv 'IsDynamicBlock) :VLAX-TRUE) ; chk if dynamic block 
   (vlax-get-property objv 'EffectiveName) 
   (cdr (assoc 2 (entget ent-arg)))
  )
 ) ; defun 
;; No longer implementing following:
;; Edit below to match with Block name and Attribute Tag name 
;  (setq 
;        aec_blk_name "TITLE_BLOCK_INFORMATION_NEW_OCT 19-2010" ; "YOURTITLEBLOCKNAME"
;        aec_tag_name "SHEET#" ; "YOURATTRIBUTETAG"
;  ) ; setq
;; Implement Select Attribute:
 (while (not aec_blk_name)
  (setq aec_blk_name (nentsel"\nSelect Attribute Tag To Enter Page Number Fields:" ))
  (if 
   (or
    (not aec_blk_name)
    (not (equal "ATTRIB" (cdr(assoc 0(setq ed(entget(setq en(car aec_blk_name))))))))
   )
   (progn                                  ; then did not select Attribute
    (setq aec_blk_name nil)
    (princ"\nObject Selected is Not an Attribute...")(princ)
   )
   (progn
    (setq aec_tag_name (cdr(assoc 2 ed)))           ; get & set global Attribute Tag name
    (setq aec_blk_name (aec_chkblknam(cdr(assoc 330 ed)))) ; get & set global Block name including Dynamic
    ; # to reduce total layout tab count
    (if(not aec_tabnum_tot)(setq aec_tabnum_tot 0)) ; set global # to subtract from total Layout quantity
    (if (setq num(getint(strcat"\nEnter Number To Subtract from Total Layout Quantity: <"(itoa aec_tabnum_tot)">: ")))
     (setq aec_tabnum_tot (abs num))
    ) ; if
    (alert
     (strcat
      "Running TabNumber on Block Attributes Found in Layouts\n"
      "Subtracting Total Layout Quantity by: [" (itoa aec_tabnum_tot) "]\n"
      "Block Attributes Found in Model tab are Ignored."
     ) ; strcat
    ) ; alert
   ) ; progn
  ) ; if
 ) ; while
 (if aec_blk_name
   (progn                                  ; Attribute selected
    (setq	ctab (getvar"ctab")) ; save current Layout
    (if (setq s (ssget "_A" (list '(0 . "INSERT") (cons 2 (strcat aec_blk_name ",`*U*")) '(66 . 1)))) ; get all matching Blocks including Dynamic
     (progn
      (foreach b (mapcar 'cadr (ssnamex s))  ; create list of all entities from selection set & cycle through
       (if 
        (and 
         (= 'ename (type b)) ; confirm is entity
         (setq tabnam(cdr (assoc 410 (entget b)))) ; get Layout name where Block is placed
         (/= tabnam "Model") ; ignore Block if placed in Model
        )
        (progn
         (setvar "ctab" tabnam) ; make Layout current
         (setq fld (_lay2fld aec_tabnum_tot))  ; get Field value
         (_put (vlax-ename->vla-object b) aec_tag_name fld) ; place Field value into Attribute
        ) ; progn
       )  ; if
      ) ; then loop
      (if(equal (getvar"ctab") ctab) ; chk if last Layout in loop matches with original
       (command"_.Regen") ; then regen to update Fields
       (setvar"ctab"ctab) ; else return to original Layout 
      ) ; if
      (alert"TabNumber Completed Successfully.\nTo Reselect Another Run Command:\n[TabNumberClr]")
     ) ; progn
     (alert
      (strcat"No Matching Blocks Named:\n\t[" 
            aec_blk_name 
            "]\nWith Attribute Tag Named:\n\t["
            aec_tag_name
            "]\nFound in Current Drawing."
      )
     ) ; else alert
    ) ; if Blocks found
   ) ; progn Attrib selected
  ) ; if aec_blk_name
(princ)
) ; defun TabNumber
; TabNumberClr function
(defun c:tabnumberclr ()
 (setq aec_blk_name nil) ; clear global Block name
 (princ"\nTABNUMBER Successfully Cleared.")(princ)
 (c:tabnumber) ; run TabNumber function
); defun TabNumberClr
(princ"\n...Loaded Successfully...Enter Command:\n\t[TABNUMBER] to Execute.\n\t[TABNUMBERCLR] to Reselect.")(princ)

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 8 of 11

khairulbasharcivil06
Participant
Participant
Thank you very much for your kind support. It' s working nicely .
0 Likes
Message 9 of 11

paullimapa
Mentor
Mentor

Glad to have helped...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 10 of 11

SamTheCadMan
Observer
Observer

I am running into an issue. When I run this lisp command, it works an works perfectly. I modified it since I don't need the "Of XX" part. However, when I run this command it can find my block and attribute, modifies it, but then creates a random MText. It only does this to some of my pages, but it is a problem because when I publish the file to PDF some pages fit all of the paper space, and some fit half because it has to include that random MText. 

 

What I've done so far,

  • Double check the block name and attribute
  • Check the MText for block association
    • It almost duplicates the block and everything is empty in the attributes BUT the page number
    • However it makes it into a different layer
  • Checked Block Manager and it says that there are 2 instances within my layout
0 Likes
Message 11 of 11

paullimapa
Mentor
Mentor

share your revised code and a sample drawing with this issue.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes