I am trying to load and run a .dvb file on every drawing file load in Autocad2012. I am trying to automate this thing like if anybody opens a .dwg file VBA will run automatically.
Asked
Active
Viewed 3,567 times
2 Answers
1
You should stop using vba. It's no longer supported, since 2010.
You can load a dvb and run it via lisp Using the command vbaload.
(Vbaload "path")
(Command "yourCommandName")
If a VBA application is already loaded, and you run Vbaload, you get an error.
You will need to add your lisp file in the startup suite using the appload command
Or
What you will need to do is, rewrite your dvb in c# or vb.net and have AutoCAD run your .net method when it opens by passing this in a lisp
(Command "netload" "PathToThe.dll")
(Command "theCommandYouSpecify")

Trae Moore
- 1,759
- 3
- 17
- 32
1
Ok I got it. It contains two step 1.) Create a Autolisp(.lsp) file in the folder in which your .DWG file is placed with the name "acaddoc.lsp".
2.) write the following command. (defun S::STARTUP() (command "_-vbarun" "D:\Test File\acad.dvb!Module1.AcadStartup"). )

Rahul
- 1,070
- 3
- 21
- 47
-
I think you could have done better with the approach. What happens if you move the drawing to a different folder? You should centralize what you want to load so that if you need to edit it or if someone else needs to edit it, they can look and see what your loading and the file locations in appload. – Trae Moore Jul 22 '13 at 23:18