(defun c:clean-scr-e ()
(GCI)
(vlt)
(Esize)
(princ)
)
(defun c:clean-scr-d ()
(GCI)
(vlt)
(Dsize)
(princ)
)
(defun GCI(/ newdictlist)
(cond
((setq newdictlist (dictsearch (namedobjdict) "GcImageDef_Dict")) (dictremove (namedobjdict) "gcImageDef_Dict")))
; (alert "\nThe GcImageDef_Dict has been removed."))
; ((alert "\nGcImageDef_Dict does not exist.")))
(princ)
)
;
;
(defun vlt ( / ss ) (vl-load-com)
(command "._units" "2" "6" "1" "0" "0" "n")
(if (setq ss (ssget "_X" '((0 . "VIEWPORT"))))
(princ
(strcat "\n--> LTSCALE set to "
(rtos
(setvar 'LTSCALE
(/ 1.
(* 4.0
(vla-get-CustomScale
(vlax-ename->vla-object (ssname ss 0))
)
)
)
)
)
" <--"
)
)
)
(princ)
)
;
;
(defun Esize ()
;
(command "._layer" "set" "0" "")
(command "._layout" "set" "")
(command "._ZOOM" "E")
(command "._viewres" "y" "10000")
(command "._mview" "lock" "on" "all" "")
(command "._units" "2" "6" "1" "0" "0" "n")
(command "._ZOOM" "w" "40.5,3.5,0.0" "44.3,0.23,0.0")
(command "._LWDISPLAY" "off")
(command "._units" "4" "2" "1" "0" "0" "n")
(command "._purge" "all" "*" "n")
(command "._purge" "all" "*" "n")
(command "._INSERT" "BGE_LayerBlock=Q:/Std/BG&E/CADstandards/BGE-Standards.dwg" "0,0" "1" "1" "0" "._erase" (entlast) "" "._purge" "B" "BGE_layerBlock" "N")
(command "._Filedia" "0")
(command "._saveas" "2000" "" "y")
(command "._Filedia" "1")
(command "textscr")
(command "graphscr")
(princ)
)
(defun Dsize ()
;
(command "._layer" "set" "0" "")
(command "._layout" "set" "")
(command "._ZOOM" "E")
(command "._viewres" "y" "10000")
(command "._mview" "lock" "on" "all" "")
(command "._units" "2" "6" "1" "0" "0" "n")
(command "._ZOOM" "w" "30.5,3.5,0.0" "34.3,0.2,0.0")
(command "._LWDISPLAY" "off")
(command "._units" "4" "2" "1" "0" "0" "n")
(command "._purge" "all" "*" "n")
(command "._purge" "all" "*" "n")
(command "._INSERT" "BGE_LayerBlock=Q:/Std/BG&E/CADstandards/BGE-Standards.dwg" "0,0" "1" "1" "0" "._erase" (entlast) "" "._purge" "B" "BGE_layerBlock" "N")
(command "._Filedia" "0")
(command "._saveas" "2000" "" "y")
(command "._Filedia" "1")
(command "textscr")
(command "graphscr")
(princ)
)
(princ)
I run this in script pro to batch 100's of drawings with the lisp above
(load"bgeClean")
clean-scr-d
(load"bgeClean")
clean-scr-e
Only problem is that I have too run these on different sets of plans because some are E size and some are D size....
What I need help with is some how being able to run only 1 script file on all of the drawings and for the lisp to find the a block attribute and then tell lisp or script which one to run for that given size of file...
The Block name is: BORDER
The Tag that holds the attribute it would need to read is: SIZE
The 2 values i would need are: E or D
If its E then it should run "clean-scr-e"
If its D then it should run "clean-scr-d"
It makes sense in my head...
Thanks in advance