Message 1 of 2
Updateing Attribute in layout tabs

Not applicable
08-16-2007
08:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to write a Lisp routine that will update a date attribute in all the layout tabs in my dwg.
I have successfully wrote one for a single tab dwg but now want the routine to the same but for all layouts in my dwg.
Here is what i have done so far.
The routine scrolls thru the layouts but only updates the Date attribute on the last tab
(defun C:PDT()
;(setvar "cmdecho" 0)
(setq today (menucmd "m=$(edtime,$(getvar,date),mo.dd.yy)"))
(setq Tag (ssget "x" (list (cons 0 "insert") (cons 2 "ttlblk-attribute"))))
(setq Block (entget (ssname Tag 0)))
(setq Att (entget (entnext (cdr (assoc -1 Block)))))
(setq OldDate (cdr (assoc 1 Att)))
(setq Data (subst (cons 1 OldDate) (assoc 1 Att) Att))
(entmod Data)
(foreach layout (layoutlist)
(setvar "ctab" layout))
(command ".-attedit" "n""n" "*" "XX-XX-XXXX" "" OldDate today)
;(command "graphscr")
;(setvar "cmdecho" 1)
(PRINC))
I have been scrolling thru the forums here but can't find something that helps me get over the final hurdle.
from info gained from the forums I thought the above would get a list of the layouts and switch from layout to layout and execute the command??
Any and all help much appreciated.
Thx in advance
Paul
I'm trying to write a Lisp routine that will update a date attribute in all the layout tabs in my dwg.
I have successfully wrote one for a single tab dwg but now want the routine to the same but for all layouts in my dwg.
Here is what i have done so far.
The routine scrolls thru the layouts but only updates the Date attribute on the last tab
(defun C:PDT()
;(setvar "cmdecho" 0)
(setq today (menucmd "m=$(edtime,$(getvar,date),mo.dd.yy)"))
(setq Tag (ssget "x" (list (cons 0 "insert") (cons 2 "ttlblk-attribute"))))
(setq Block (entget (ssname Tag 0)))
(setq Att (entget (entnext (cdr (assoc -1 Block)))))
(setq OldDate (cdr (assoc 1 Att)))
(setq Data (subst (cons 1 OldDate) (assoc 1 Att) Att))
(entmod Data)
(foreach layout (layoutlist)
(setvar "ctab" layout))
(command ".-attedit" "n""n" "*" "XX-XX-XXXX" "" OldDate today)
;(command "graphscr")
;(setvar "cmdecho" 1)
(PRINC))
I have been scrolling thru the forums here but can't find something that helps me get over the final hurdle.
from info gained from the forums I thought the above would get a list of the layouts and switch from layout to layout and execute the command??
Any and all help much appreciated.
Thx in advance
Paul