PDA

View Full Version : Batch Convert DWG to Visio



ShawnF
2011-12-06, 02:36 PM
Hi all: I've done some searches on "visio" and found bunches of information already, but not what I'm looking for.

What I'm trying to do is batch convert DWG > VSD. I really don't want to Insert DWG individually into each VSD file.

I thought about trying to go DWG>EPS> VSD with some kind of batch converter outside of AutoCAD, but can't fine a "TO" VSD, only a "FROM" VSD (like VSD>PDF)

Fidelity is important (layer control in the VSD).

Any ideas?

Thanks,
Shawn

BlackBox
2011-12-06, 02:51 PM
I do not have MS Visio installed to test myself, but perhaps you can automate the DWG insertion process?

Pseudo code:



(defun c:FOO ( / oVisioApp)
(vl-load-com)
(if
(setq oVisioApp (vlax-get-or-create-object "Visio.Application"))
(progn
;;
;; <-- DWG insertion
;;
(setq oVisioApp (vl-catch-all-apply
'vlax-release-object
(list oVisioApp))))
(prompt "\n** Unable to create \"Visio.Application\" Object ** "))
(princ))

dgorsman
2011-12-06, 07:29 PM
Aside from "Ugh, Visio?!?" :lol:... doesn't Visio support DXF format?

ShawnF
2011-12-07, 02:18 AM
Visio supports DWG and DXF directly, it's just the batch portion...I have a client who has this as a secondary (but contractual) deliverable.

I'll look through the code...need to find something to recurse through a directory...

BlackBox
2011-12-07, 06:44 AM
Look into vl-directory-files + foreach function combo. :wink: