I want to import the views from over 1700 drawings into one drawing. I have seen VIEWIMP.LSP by Tony Tanzillo and it is great for selecting one drawing at a time, but I want to process all drawings in a directory. It could be either using a list of drawing names or by selecting the directory or by selecting the multiple files (like for xref attach). Any ideas are greaty appreciated.
I found a way to do what I need. I noticed the Thread: get bounds of a block (thanks devitg) and used the code there as a starting point.
The views needed are for the extents of the 1700 drawings. So I xref's the drawings on layer "0" and ran the following code. Some of the file names have extra text after a "_" so the testmode part is to strip that off and use only the front part of the drawing name for the view name.
My code is a quick beginning, so if anyone want to suggest improvements here's what I have:
(defun MYVIEWMAKE ()
(setq D-L NIL)
(setq U-R NIL)
(setq ONE (vlax-ename->vla-object (ssname SS INDEX)))
(setq MYOBJECT (vla-get-objectname ONE))
(if (= (vla-get-objectname ONE) "AcDbBlockReference")
(if (vlax-method-applicable-p ONE 'GETBOUNDINGBOX)
(progn (vla-getboundingbox ONE 'min 'max)
(setq D-L (vlax-safearray->list min)) ;_ the down left point
(setq LLXX (car D-L))
(setq LLYY (cadr D-L))
(setq LLXX_TXT (rtos (car D-L)))
(setq LLYY_TXT (rtos (cadr D-L)))