Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACADProject in VBA Editor

Status
Not open for further replies.

hbendillo

Electrical
Jan 24, 2003
88
When I load a dvb file it creates a new Project in the VBA Editor and the project name ends up being something like this:

ACADProject(C:\Path name to DVB file)

Initially I had a ACADProject(Global1) but it seems to be gone. The reason I am describing this is because I am having a problem I think is related. I tried to create a custom toolbar button that would load a Macro that I have in my Project Module. I cannot get it to work. When I look at the Macro in my Macro List, it is listed with a path back to the project DVB. That is how I list the macro in my button properties but it does not work. I also tried to just list the macro name but that does not work either. Any suggestions or comments?
 
Replies continue below

Recommended for you

You can put your code into the acad.dvb project which automatically loads when AutoCAD is started. It should be located in you AutoCAD main directory.
Or you can create a acad.lsp file and have AutoCAD load your project on startup. You need the following lines in the .lsp file:

(defun S::STARTUP()
(command "_VBALOAD" "gloabl2.dvb")
)

but your global2.dvb needs to be in the AutoCAD main directory to work.
 
You can also add the location of the project in the support file search path, point to location in autocad by using the startup suite. Then create a button and put this in it:
^C^C-VBARUN PROJECTNAME.DVB!PROJECTNAME

If you don't have a module in your project add one and put the following in it.

Public Sub BlockInsert()
FRMPROJECTNAME.Show
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor