Not really what i was looking for but thanks any way.
I have found this code on the www but i aint'working
; Create AutoCAD Block Libray sheets
;
(prompt "\n**********************************")
(prompt "\n Created by /|/| ")
(prompt "\n / | |anfred Wachelder ")
(prompt "\n**********************************")
(terpri)
(setq BUMPNO 0)
(Defun bump (message)
(setq BUMPNO (logand (1+ BUMPNO) 3))
(princ
(strcat "\r" message "["
(nth BUMPNO '("|" "/" "-" "\\"))
"] ... "
)
)
)
(defun echooff()
(setq oldecho (getvar "CMDECHO"))
(setq oldblip (getvar "BLIPMODE"))
(setvar "CMDECHO" 0)
(setvar "BLIPMODE" 0)
(setq olderror *ERROR*)
(terpri)
(defun *ERROR* (msg)
(princ " \n")
(princ msg)
(echoon)
)
)
;
(defun echoon()
(setvar "CMDECHO" oldecho)
(setvar "BLIPMODE" oldecho)
(setq *ERROR* olderror)
(princ)
)
;degress to radian conversion
(defun dgtrd(a)
(* a (/ PI 180.0))
)
;rectangular coordinate offset
(defun newpt (a b c d e / x)
(setq x (polar a (dgtrd c) b))
(setq x (polar x (dgtrd e) d))
(setq x x)
)
;build selection set
(defun buildss ()
(setq ss (ssadd))
(setq ss (ssadd (entnext lastent) ss))
(setq lastent (entnext lastent))
(while (setq nextent (entnext lastent))
(progn
(bump message)
(setq ss (ssadd nextent ss))
)
(setq lastent nextent)
)
)
;strip off trailing blanks
(defun strip (olds / news)
(setq slg (strlen olds))
(setq news "")
(setq idx 1)
(while (<= idx slg)
(if (>= (ascii(substr olds idx 1)) 45)(setq news (strcat news (substr olds idx 1))))
(setq idx (+ idx 1))
)
(setq news news)
)
;create MVIEW for each block
(defun mdisplay(str)
(setq counter 0)
(command "._LAYER")
(while (/= counter (length blist))
(if (/= (nth counter blist) str)
(command "_FREEZE" (nth counter blist))
)
(bump message)
(setq counter (1+ counter))
)
(command "")
(command "._ZOOM" "_E")
(command "._ZOOM" "0.9x")
(command "._LAYER" "_THAW" "*" "")
(setq counter 0)
(command "._VPLAYER")
(while (/= counter (length blist))
(if (/= (nth counter blist) str)
(command "_FREEZE" (nth counter blist) "_C")
)
(bump message)
(setq counter (1+ counter))
)
(command "")
)
;insert AUTOCAD LIBRARY sheet
(defun ins_border(m n)
(setq cpt (newpt n 5.5 0 4.25 90))
(command "._ZOOM" "_C" cpt 10)
(setq sheetno 1)
(if (= (rem m 15) 0)
(setq maxsheet (/ m 15))
(setq maxsheet (+ (/ m 15) 1))
)
(while (<= sheetno maxsheet)
(command "._INSERT" "BlkSheet" n "1" "1" "0")
(command "._TEXT" "_M" (newpt n 10.75 0 4.5 90) 0.125 90 (strcat "PAGE " (itoa sheetno)))
(command "._VIEW" "_S" sheetno)
(setq n (polar n 0 12))
(setq cpt (polar cpt 0 12))
(command "._ZOOM" "_C" cpt 10)
(setq sheetno (+ sheetno 1))
)
)
;Main Program
(defun c:BlkSheet()
;; (echooff)
(setq bflag 0)
(prompt "\nCreating DWG list")
(terpri)
(setq File$ "dir /b /on *.dwg > $File$.ac$")
(command "sh" File$)
(prompt "\nInitializing ... ")
(terpri)
(command "._STYLE" "ROMANS" "ROMANS" 0 1 0 "_N" "_N" "_N")
(command "._UCSICON" "_OFF")
(if (= (getvar "TILEMODE") 0)(setvar "TILEMODE" 1))
(command "._COLOR" "_RED")
(command "._POINT" (list 0 0))
(command "._COLOR" "_BYLAYER")
(command "._ZOOM" "_C" (list 0 0) 10)
(setq f1 (open "$File$.ac$" "r"))
(setq blist (list))
(princ "CREATING LAYERS AND INSERTING ALL BLOCKS\n")
(while (/= (setq txt (read-line f1)) nil)
(setq txt (strip txt))
; ltxt = file.dwg - .dwg
(setq ltxt (substr txt 1 (- (strlen txt) 4)))
(setq blist (append blist (list ltxt)))
(command "._LAYER" "_N" ltxt "")
(setq lastent (entlast))
;(prompt (strcat "\nBlockname : " txt))
(setq message (strcat "Blockname : " txt " - " ))
(command "._INSERT" (strcat "*" ltxt) "0,0" "1" "90")
(buildss)
(command "._CHANGE" ss "" "_P" "_LA" ltxt "")
)
(close f1)
(command "._LAYER" "_SET" "0" "")
(setq blockcnt (length blist))
(command "._ZOOM" "_E")
(if (= (getvar "TILEMODE") 1)(setvar "TILEMODE" 0))
(ins_border blockcnt (list 0 0))
(setq index 0)
(setq sheetno 1)
(setq llc (list 1.5 1))
(while (= bflag 0)
(if (= bflag 0)(command "._VIEW" "_R" sheetno))
(setq row 1)
(setq column 1)
(while (/= row 4)
(while (/= column 6)
(setq urc (newpt llc 1.5 0 2 90))
(if (nth index blist)
(progn
(setq message (strcat "Sheet : " (itoa sheetno) " of " (itoa maxsheet) ", Block " (itoa (+ index 1)) " of " (itoa blockcnt) " - " ))
(command "._MVIEW" llc urc)
(command "._TEXT" "_C" (newpt llc 0.0625 180 1 90) 0.125 90 (nth index blist))
(command "._MSPACE")
(mdisplay (nth index blist))
(command "._PSPACE")
)
(progn
(setq column 5)
(setq row 3)
(setq bflag 1)
)
)
(setq llc (newpt llc 1.875 0 0 90))
(setq column (+ column 1))
(setq index (+ index 1))
)
(setq llc (newpt llc 9.375 180 2.5 90))
(setq column 1)
(setq row (+ row 1))
)
(setq sheetno (+ sheetno 1))
(setq llc (newpt llc 12 0 7.5 270))
)
(command "._PSPACE")
(echoon)
(command "._UCSICON" "_OFF")
(prompt "\n\n\n\nUse blkplot to plot the sheets.")
(princ)
)
(princ)
;
; ---------------------------------
;create script file
(defun lplot(a b c d)
(prompt "\n\n\n")
(command "_PLOT" "_V" (+ index 1) "")
)
;
;Main Program
(defun c:blkplot()
(echooff)
(setq shtno (getint "\nEnter number of sheets: ")
index 0)
(while (/= index shtno)
(lplot (* index 12) 0 (+ (* index 12) 11.0) 8.5)
(setq index (+ index 1))
)
(echoon)
)
Who can tell me what is wrong with it.?