Import CAD file with VBA

Started by VisGuy, April 08, 2021, 02:28:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VisGuy

Hi,

I am getting automation error while importing dwg file.

Can anyone help or share some basic code to import dwg and convert.



Dim pagObj As Visio.Page           ' Page to work in.

pagObj.Import ("C:\Users\parth2dwg\filename.dwg")


Surrogate

#1
Method Page.Import can work only with pictures
Quote from: M$FT in article Page.Import method (Visio)This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Import method to import a bitmap image onto the drawing page.


PS for open and insert dwg file you need use addon - Insert AutoCAD Drawing
Addons("Insert AutoCAD Drawing").Run ("C:\Users\parth2dwg\filename.dwg")