Author Topic: Automatically cataloging blocks/symbols on a sheet.  (Read 3192 times)

0 Members and 1 Guest are viewing this topic.

MvdP

  • Guest
Automatically cataloging blocks/symbols on a sheet.
« on: September 05, 2006, 12:24:06 PM »
I have a huge amount of blocks/symbols in several directories.
And i want to insert  each and every block in each directory on a on a 8 x 11 inch sheet (a total f.i. 12 symbols on a sheet and on as many sheets needed).
And that is a LOT of work.So now i am searching for a routine to do this automatically.
Who has or knows a routine to do this.?

Thanks

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #1 on: September 05, 2006, 01:30:16 PM »

Freebie -> DWGLIST.EXE @ http://www.dotsoft.com/freestuff.htm
Similar tool with more features in ToolPac -> http://www.dotsoft.com/toolpac.htm

CottageCGirl

  • Guest
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #2 on: September 05, 2006, 08:56:57 PM »
oooo, thats neat! have to try it in the am...thnx

CottageCGirl

  • Guest
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #3 on: September 06, 2006, 12:18:52 PM »

Freebie -> DWGLIST.EXE @ http://www.dotsoft.com/freestuff.htm
Similar tool with more features in ToolPac -> http://www.dotsoft.com/toolpac.htm


That is SOOOOOO Cooooool...I love you man........ :-D

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #4 on: September 06, 2006, 01:14:16 PM »

That is SOOOOOO Cooooool...I love you man........ :-D

Pass some of that on to Terry --> http://www.dotsoft.com/contact.htm

 :angel:

CottageCGirl

  • Guest
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #5 on: September 06, 2006, 02:46:34 PM »

MvdP

  • Guest
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #6 on: September 07, 2006, 09:03:07 AM »
Not really what i was looking for but thanks any way.
I have found this code on the www but i aint'working

Code: [Select]
; 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.?

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Automatically cataloging blocks/symbols on a sheet.
« Reply #7 on: September 08, 2006, 10:56:04 PM »

Why not simply use script routine ?
Keep smile...