Message 1 of 4
Autocad within a Windows Form
Not applicable
03-20-2009
10:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is probably a question that has been asked and answered, but I need a little direction.
I have inherited a VB application that communicates with AutoCAD via the AutoCAD dll properties and methods (Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common). The basic functionality of the application is to link CAD Objects to SQL data via the Handle (Stored in the SQL DB), and pass data between the database and Object when actions are initiated by the VB application.
I would like to reengineer this application to be a little more usable, but have some questions as to what is the best method, based on what is available since this source code was written circa 2002. Ideally, I would like the VB application to have a control(?) that contains the AutoCAD drawing / environment, which would allow pushing data to the drawing from the VB app and trap in VB when selecting an object in CAD, rather than having to switch between VB app and CAD drawing. The other issue is that I have to recompile the application with the latest AutoCAD dlls every time a new CAD version is released (pretty much every year), and the application needs to support all recent versions of AutoCAD (can live with 2006 forward, if optimal solution eliminates need to recomplie each year).
The application really doesn't need to manipulate the drawing, other than setting the text and possibly the ability to position a text object.
What I would like to have happen is for:
- VB App establish connection to dwg file (perferably in a window / control on the VB form)
- VB App to choose objects on appropriate layer and select that layer in the drawing
- VB App to choose SQL record to link to CAD object
- Clicking on a CAD object in the selected layer passes it's Handle back to VB
- VB App to create a text object centered over the CAD object
- VB App to push information back to the new CAD text object
- (Optional) ability to manipulate the text object
Any suggestions / success stories / source code samples ?
I have inherited a VB application that communicates with AutoCAD via the AutoCAD dll properties and methods (Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common). The basic functionality of the application is to link CAD Objects to SQL data via the Handle (Stored in the SQL DB), and pass data between the database and Object when actions are initiated by the VB application.
I would like to reengineer this application to be a little more usable, but have some questions as to what is the best method, based on what is available since this source code was written circa 2002. Ideally, I would like the VB application to have a control(?) that contains the AutoCAD drawing / environment, which would allow pushing data to the drawing from the VB app and trap in VB when selecting an object in CAD, rather than having to switch between VB app and CAD drawing. The other issue is that I have to recompile the application with the latest AutoCAD dlls every time a new CAD version is released (pretty much every year), and the application needs to support all recent versions of AutoCAD (can live with 2006 forward, if optimal solution eliminates need to recomplie each year).
The application really doesn't need to manipulate the drawing, other than setting the text and possibly the ability to position a text object.
What I would like to have happen is for:
- VB App establish connection to dwg file (perferably in a window / control on the VB form)
- VB App to choose objects on appropriate layer and select that layer in the drawing
- VB App to choose SQL record to link to CAD object
- Clicking on a CAD object in the selected layer passes it's Handle back to VB
- VB App to create a text object centered over the CAD object
- VB App to push information back to the new CAD text object
- (Optional) ability to manipulate the text object
Any suggestions / success stories / source code samples ?