TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ronjonp on March 09, 2006, 11:01:49 AM
-
How can I check (with lisp) if a VBA module is loaded in a drawing, and if it is, unload it?
I use vl-vbaload to load them but do not see an easy way to unload them?
Thanks,
Ron
-
I unload after I use them. Let find an example
-
I unload after I use them. Let find an example
I just found vla-unloaddvb. I think this will do the trick. I would still be interested to see how you unload after use.
-
Ron,
visit my homepage -> Free Stuff and search for 'VxGetLoadedVbaProjs'
-
(defun c:TepDelPS ()
(LOADER "pagesetup.dvb")
(VL-VBARUN "pagesetup.dvb!Delpconfig")
(command "vbaunload" "pagesetup.dvb")
)
and the lisp to load
(defun loader (progname /)
(vl-vbaload (findfile progname))
)
-
Thanks for the reply guys.
CMDR..
You could prolly use this in your lisp so you wouldn't have to use the command:
(defun c:TepDelPS ()
(LOADER "pagesetup.dvb")
(VL-VBARUN "pagesetup.dvb!Delpconfig")
(vla-unloaddvb
(vlax-get-acad-object)
(findfile "pagesetup.dvb")
)
)
Ron
-
cool, I will have to try that
-
be carefully to unloading dvb according the ADN
ADN explained that he had intermittently experienced problems to unloading dvb files over the network.
I did try and have some crash to unloading dvb files over the network.
-
(defun c:TepDelPS ()
(LOADER "pagesetup.dvb")
(VL-VBARUN "pagesetup.dvb!Delpconfig")
(command "vbaunload" "pagesetup.dvb")
)
and the lisp to load
(defun loader (progname /)
(vl-vbaload (findfile progname))
)
Another remark:
If you are using vl-vbarun, you haven't to load the dvb. Vl-vbarun does this automatically...
(vl-vbarun (strcat (findfile "MyOwn.dvb") "!MyModule.MyMacro"))
Edited: missing parenthesis
-
thats good to know!