Message 1 of 6
Help - Converting an App from VBA to VB

Not applicable
06-11-2001
10:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have developed a small application as an AutoCAD VBA Project and I
want to convert the project to VB. I am having a few conceptual
difficulties in getting started and would appreciate a few pointers in
the right direction. I seem to have had little luck in finding info in
the documentation or other books. The only book I have managed to find
is Andrew Roe's "Using VB with AutoCAD".
Basically the project at present is a single .DVB file. I have about
ten AutoCAD commands which run macros in the DVB and these are set up
in AcadDoc.lsp. I presumed at first that I should set up the project
as a DLL, but I can't see how I would call the macros from AutoCAD. I
successfully created a DLL, registered it, set up the references to
the DLL in a dummy DVB file for testing but it won't seem to see the
Public Functions in the DLL.
I thought maybe I should split the project up into a series of
projects (one for each AutoCAD command) and create them as an .EXE
file. I can get this to work but my global variables no longer have
scope in all the modules and I still have the problem referring to
subs and functions that are common to all the commands.
Finally I have an ObjectModified event in the "ThisDrawing" section of
the DVB. I can't seem to see where this would go in a VB file. I can
see how to use GetObject to get the ActiveDocument, but can't seem to
figure how to set up an ObjectModified event.
I would appreciate a nudge in the right direction.
Ian Thomson
want to convert the project to VB. I am having a few conceptual
difficulties in getting started and would appreciate a few pointers in
the right direction. I seem to have had little luck in finding info in
the documentation or other books. The only book I have managed to find
is Andrew Roe's "Using VB with AutoCAD".
Basically the project at present is a single .DVB file. I have about
ten AutoCAD commands which run macros in the DVB and these are set up
in AcadDoc.lsp. I presumed at first that I should set up the project
as a DLL, but I can't see how I would call the macros from AutoCAD. I
successfully created a DLL, registered it, set up the references to
the DLL in a dummy DVB file for testing but it won't seem to see the
Public Functions in the DLL.
I thought maybe I should split the project up into a series of
projects (one for each AutoCAD command) and create them as an .EXE
file. I can get this to work but my global variables no longer have
scope in all the modules and I still have the problem referring to
subs and functions that are common to all the commands.
Finally I have an ObjectModified event in the "ThisDrawing" section of
the DVB. I can't seem to see where this would go in a VB file. I can
see how to use GetObject to get the ActiveDocument, but can't seem to
figure how to set up an ObjectModified event.
I would appreciate a nudge in the right direction.
Ian Thomson