.NET

Reply
Contributor
BrianWren
Posts: 11
Registered: ‎09-08-2000
Message 1 of 2 (351 Views)

External programming: VB.NET; DWG reading DLL

351 Views, 1 Replies
12-08-2006 09:43 AM
I had posted this at http://discussion.autodesk.com/thread.jspa?messageID=5419683늣, and it was suggested in a reply to post it here...

I need to read an existing .dwg, get the block refs in it, and (for a specific block name) grab the attributes to import into an Oracle DB.

I was unable to figure out a way to open AutoCAD from within VB.NET 2005, use the reference thus obtained to open a drawing in that instance of AutoCAD, and then work with the drawing’s block references.

What are the appropriate References to add to my VB project, and what are the names of the type for the Acad application and the drawing?
What is the proper method to open AutoCAD?
What is the proper method to load a drawing and obtain a reference to it?


Alternately, I don’t really need to open AutoCAD if I can just process the .dwg.
Is there a DLL or other library that will allow me to extract info from a AutoCAD .dwg?
If so, the above questions still apply: How do I communicate with this library to accomplish the goals stated above?

Thanks.
*Norman Yuan
Message 2 of 2 (351 Views)

Re: External programming: VB.NET; DWG reading DLL

12-08-2006 10:26 AM in reply to: BrianWren
You use ActiveX automation to get an AutoCAD application object instance.
Automating AutoCAD is quite similar to automation MS Word/Excel, if you
happen to know that. You need to study AutoCAD object model to know how to
manipulate AutoCAD/drawing's objects.

You need to set reference to AutoCAD type library (unless you use late
binding).

You need to start AutoCAD, then open the drawing in AutoCAD, in order to
read drawing information. That means, AutoCAD installation and running
session of AutoCAD are required, unless you lisnece very expensive RealDwg
from Autodesk.

If also need to pay attention to AutoCAD version compatibility if your app
runs against different versions of AutoCAD.

wrote in message news:5419684@discussion.autodesk.com...
I had posted this at
http://discussion.autodesk.com/thread.jspa?messageID=5419683늣, and
it was suggested in a reply to post it here...

I need to read an existing .dwg, get the block refs in it, and (for a
specific block name) grab the attributes to import into an Oracle DB.

I was unable to figure out a way to open AutoCAD from within VB.NET 2005,
use the reference thus obtained to open a drawing in that instance of
AutoCAD, and then work with the drawing's block references.

What are the appropriate References to add to my VB project, and what are
the names of the type for the Acad application and the drawing?
What is the proper method to open AutoCAD?
What is the proper method to load a drawing and obtain a reference to it?


Alternately, I don't really need to open AutoCAD if I can just process the
.dwg.
Is there a DLL or other library that will allow me to extract info from a
AutoCAD .dwg?
If so, the above questions still apply: How do I communicate with this
library to accomplish the goals stated above?

Thanks.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.