Ron Sweet code, but my basic code does what I need. However, your code could eliminate the user having to even enter "Number of Sheets". But have a look at my code, its a little different that yours. You have yours putting the string at 0,0 in each layout. My code is always in model space and prompts the user to specify number of sheets then prompts user to place text (this is not automated because sometimes our titleblocks are on the left, and other times they are on the right).
- (DEFUN C:DWG(/ *error* count countup oldlayr t_size point dwgof)(setvar "cmdecho" 0) (defun *error* (msg) (if oldlayr (setvar "clayer" oldlayr) ) )(SETQ COUNT (GETSTRING "\nHow many drawings do you have? "))(SETQ COUNTUP 1)(setq oldlayr (getvar "clayer"))(setq t_size 0.08) (REPEAT (ATOI COUNT) (SETQ DWGOF (STRCAT "DWG " (TRIM (ITOA COUNTUP)) " OF " (TRIM COUNT))) (setq point (getpoint "\nPick Text Placement: ")) (command "layer" "s" "text" "") (command "._text" "L" point t_size "0" DWGOF) (COMMAND "MOVE" "L" "" "0,0" "0,.05") (SETQ COUNTUP (1+ COUNTUP)) )(SETVAR "CLAYER" OLDLAYR)(PRINC))
|