What's wrong in the code below?
Should export a new drawing for a block contained in another design without opening it
(setq
*acad* (vlax-get-acad-object)
doc (vla-get-activedocument *acad*)
desenho "C:\\Arquivos de programas\\AutoCAD 2007\\support\\db_samp.dwg"
)
(setq oDBX (vla-GetInterfaceObject *acad* "ObjectDBX.AxDbDocument.17"))
(vla-open oDBX desenho)
(vlax-for layout (vla-get-layouts oDBX)
(vlax-for blk (vla-get-block layout)
(if (and
(= (vla-get-objectname blk) "AcDbBlockReference")
(= (strcase (vla-get-name blk)) "CHAIR7")
)
(setq nomes_lst (cons blk nomes_lst))
)
)
nomes_lst
)
(setq SAwallobj (vlax-make-safearray vlax-vbObject '(0 . 0)))
(vlax-safearray-fill SAwallobj (car nomes_lst)) ; error here
(vla-wblock oDBX "c:/bloco.dwg" SAwallobj) ; and error here too
Marcos Mendes
Visit my site:
http://www.autolisp.com.br/