Visual Basic Customization

Visual Basic Customization

Reply
Valued Contributor
OceanaPolynom
Posts: 81
Registered: ‎12-22-2008
Message 1 of 3 (258 Views)

Open dwg file from code

258 Views, 2 Replies
12-14-2012 02:41 AM

Hello

I want to open a dwg file from code in my program.  I have a string variable containing the full path and file name.  I want to open the dwg file in an instance of Autocad that is already running, I don't want to open Autocad.  The program is written in VB 6.0.  Is this possible?

 

Thank you

John

*Expert Elite*
Alfred.NESWADBA
Posts: 9,401
Registered: ‎06-29-2007
Message 2 of 3 (255 Views)

Re: Open dwg file from code

12-14-2012 03:07 AM in reply to: OceanaPolynom

Hi,

 

yes, is possible, use COM/ActiveX to get access to the running AutoCAD instance and start controlling it.

   Dim tAcadApp as AcadApplication   'or    as Object     if you use latebinding

   Set tAcadApp = getObject(,"AutoCAD.Application")

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
OceanaPolynom
Posts: 81
Registered: ‎12-22-2008
Message 3 of 3 (244 Views)

Re: Open dwg file from code

12-14-2012 10:20 PM in reply to: Alfred.NESWADBA

Thanks for your reply.  I am finding out what this is meanwhile

 

John

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!