What I Have Learnt So Far


Embedded
Just getting into it but at first blush; to be 'embedded' it has has to be a 'Project' ie '.dvb' or something.
See Tools->Load Appication which gives a Load/Unload Application dialog box that includes .lsp, .arx, .dvb, .dbx, and .vlx but .bas is not included. It provides a browse facility so appears to be what you use to load .dvd projects generally to enable subsequent access by one or more both of the following three actions below:-
  1. Tools->Macro->Macros Alt+F8 and click on something and then click Open.
  2. Tools->Macro->Macros->Load Project (only loads .dvb projects this time and no browse facility although it appeared to 'learn' to open at my support_vba folder after some initial work).
  3. Tools->Macro->Macros->VBA Manager (has no browse facility) (has button to go to the Visual Basic Editor).
Tools->Macro->Macros->Visual Basic Editor Alt+F11


Loading A VBA .bas File
With a mylisp.lsp you picked up all you have to do is put in a folder in the support path and type (load "mylisp") then enter the command (say) MYLISP to run it at any time for the rest of the session.

To load a mybasic.bas file picked from I had to get into the Visual Basic Editor Alt+F11 or via a button on the VBA Manager dialog box) and go File->Import then browse for the mybasic.bas (or .frm or .cls) file, selectit and press 'Open' and a 'Module' appeared in the top side screen browser. Double clicking on this 'Module' caused an new Module to appear in the lower side screen browser and simultaneously opened the mybasic.bas in the editor. Selecting Run F5 or going back to the Acad screen and using Tools->Macro->Macros and clicking on the now displaying available macro caused the program to run succesfully. Note my computer gave 'running low on available memory message' (Homesite, AutoCad, VisualBasic Editor and Internet Explorer all up.

I now closed the VBA Editor, saved the acad drawing as vbapractice.dwg, opened another drawing, closed it and re-opened vbapractice.dwg and went Tools->Macro->Macros and there the program was. I selected it and clicked on the Run button (would not fire on a double click) and the program ran fine. I noticed when using Tools->Macro->Macros that _VBARUN was echoed offscreen below and also preceeded the first prompt on the command line. Typing VBARUN turns out to be equivalent to Tools->Macro->Macros.

Now I proceeded to shut AutoCad down to see what would happen. First I was asked did I want to save changes to 'my' global Project, I selected Yes and it prompted for a name offering the .dvb file ending. I named it mybasic.dvb and continued just to try to shut AutoCad down. Then another prompt came up asking me if I wanred to save some other aspct of my vba work (I'm losing it here), I said yes and AutoCad finally shut down. Remember I had previously saved the Autocad drawing file as vbapractice.dwg, closed it, opened and closed another drawing, and then re-opened it and re-ran the program using Tools->Macro->Macros with neary a hint of a message about saving anything to do with VBA then on shutting AutoCad down altogether I get two messages asking me to save VBA stuff (including as a .dvb project).

On starting Autocad and opening vbapractice.dwg again. Tools->Macro->Macros shows nothing in Macro box.

Tools->Macro->Load Project and in my support_vba folder I could see mybasic.dvd project available to load. Dropping the File Type down to 'All Files' showed the mybasic.bas sitting along side so it was not 'consumed' and is probably part of the project requirement (who knows).

Tools->Load Application also showed mybasic.dvd available as a project to load. I selected it and clicked Load and _appload mybasic.dvb successfully loaded. appeaeared on the command line similaly to the message you get when you use this box to load a lisp.

And no Tools->Macro->Macros shows the program ready to run.