Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running VBA Macro in AutoCAD

I'm making a .bundle folder for the plugins I've programmed for AutoCAD. At the root of the folder is my PackageContents.xml bundle where all of my Lisp plugins are autoloaded. Since .dvb is not a supported type for Autoloading I made a Lisp file to be autoloaded with the following code

(defun C:CSC ()
  (vl-vbaload "WindowsDoors.dvb")
  (vl-vbarun "WindowsDoors.dvb!CAD_STANDARD_CREATOR!CAD_STANDARD_BLOCK!CAD_STANDARD_PATH")
)

The code runs and puts my plugin, WindowsDoors.dvb into AutoCAD but when I try to use the plugin the command line gives me the following

Command -vbarun
Initializing VBA System
Macro name: RunMeWindowDoor   Execution error

Normally this would suggest a bug in the code except when I manually load this plugin with AutoCAD 2014's built in application loader under the manage tab it works fine leaving me with no idea what is wrong.

like image 766
Nick Gilbert Avatar asked Sep 18 '14 18:09

Nick Gilbert


1 Answers

I figured it out. I had to change the code to this

(defun C:LoadDVB ()
  (command "vbaload" "WindowsDoors.dvb")
)
like image 64
Nick Gilbert Avatar answered Sep 21 '22 09:09

Nick Gilbert