TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ronjonp on March 09, 2006, 11:01:49 AM

Title: How to detect if VBA module is loaded?
Post 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
Title: Re: How to detect if VBA module is loaded?
Post by: David Hall on March 09, 2006, 11:05:45 AM
I unload after I use them.  Let find an example
Title: Re: How to detect if VBA module is loaded?
Post by: ronjonp on March 09, 2006, 11:07:32 AM
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.
Title: Re: How to detect if VBA module is loaded?
Post by: Jürg Menzi on March 09, 2006, 11:10:54 AM
Ron,
visit my homepage -> Free Stuff and search for 'VxGetLoadedVbaProjs'
Title: Re: How to detect if VBA module is loaded?
Post by: David Hall on March 09, 2006, 11:11:10 AM
Code: [Select]
  (defun c:TepDelPS ()
    (LOADER "pagesetup.dvb")
    (VL-VBARUN "pagesetup.dvb!Delpconfig")
    (command "vbaunload" "pagesetup.dvb")
  )
and the lisp to load
Code: [Select]
(defun loader (progname /)
  (vl-vbaload (findfile progname))
)
Title: Re: How to detect if VBA module is loaded?
Post by: ronjonp on March 09, 2006, 11:34:52 AM
Thanks for the reply guys.

CMDR..

You could prolly use this in your lisp so you wouldn't have to use the command:

Code: [Select]
(defun c:TepDelPS ()
  (LOADER "pagesetup.dvb")
  (VL-VBARUN "pagesetup.dvb!Delpconfig")
  (vla-unloaddvb
    (vlax-get-acad-object)
    (findfile "pagesetup.dvb")
  )
)

Ron
Title: Re: How to detect if VBA module is loaded?
Post by: David Hall on March 09, 2006, 11:48:55 AM
cool, I will have to try that
Title: Re: How to detect if VBA module is loaded?
Post by: Humbertogo on March 09, 2006, 11:50:11 AM
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.
Title: Re: How to detect if VBA module is loaded?
Post by: Jürg Menzi on March 09, 2006, 12:12:05 PM
Code: [Select]
  (defun c:TepDelPS ()
    (LOADER "pagesetup.dvb")
    (VL-VBARUN "pagesetup.dvb!Delpconfig")
    (command "vbaunload" "pagesetup.dvb")
  )
and the lisp to load
Code: [Select]
(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
Title: Re: How to detect if VBA module is loaded?
Post by: David Hall on March 09, 2006, 12:17:17 PM
thats good to know!