TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: QuestionEverything on November 29, 2016, 06:09:31 PM
-
Hello everyone,
Is there a way to UNLOAD the visual lisp extensions?
The reverse of (vl-load-com).
-
http://www.theswamp.org/index.php?topic=42807.msg533923#msg533923
(offered in jest)
-
Hi MP,
This looks nice, but wouldn't (_KillProcess) commit a suicide, since it uses the vl- functions by itself? :lol:
Is there some standard command/function for doing this, or the only way would be to collect all the vl- functions and undefine them?
-
Suicide was the suggestion -- and why it was offered "in jest" (http://www.dictionary.com/browse/jest). :)
-
I suppose one could walk the atoms family and abuse (set to nil) all the vla-* atoms but euuuww.
If I may be so nosey -- why do you need to do this?
-
If I may be so nosey -- why do you need to do this?
+1
-
If I may be so nosey -- why do you need to do this?
It might sound stupid, but I wanted to replicate a situation to see how a code runs without ActiveX.
For example a co-worker is running a few routines on a MacOS and the only fix would be to substitute all the vl-*** functions with vanilla alternatives. :uglystupid2:
To guarantee that everything is OK, the most practical way would be to run by yourself the same stuff on the same obstacles - meaning that unload/not load at all the activeX stuff.
-
Hi,
Most vl-* functions work on MAC because they do not use ActiveX at all.
Only vla-*, vlax-* and vlr-* cannot work on MAC OS systems.
Remember the "new" (since 2012) getpropertyvalue (http://docs.autodesk.com/ACDMAC/2015/ENU/index.html?url=files/GUID-8E5913FC-09ED-4C70-AFB7-2431C062E899.htm,topicNumber=d30e362048) and setpropertyvalue (http://docs.autodesk.com/ACDMAC/2015/ENU/index.html?url=files/GUID-8F32FD8C-D81A-4DCA-B455-9D560CF17246.htm,topicNumber=d30e373984) functions can replace in many situations vla-get-* and vla-put-* (and are sometimes more powerfull).
-
If I may be so nosey -- why do you need to do this?
It might sound stupid, but I wanted to replicate a situation to see how a code runs without ActiveX.
Simply refrain from evaluating (vl-load-com) in the first place...
-
Hi,
Most vl-* functions work on MAC because they do not use ActiveX at all.
Only vla-*, vlax-* and vlr-* cannot work on MAC OS systems.
Remember the "new" (since 2012) getpropertyvalue (http://docs.autodesk.com/ACDMAC/2015/ENU/index.html?url=files/GUID-8E5913FC-09ED-4C70-AFB7-2431C062E899.htm,topicNumber=d30e362048) and setpropertyvalue (http://docs.autodesk.com/ACDMAC/2015/ENU/index.html?url=files/GUID-8F32FD8C-D81A-4DCA-B455-9D560CF17246.htm,topicNumber=d30e373984) functions can replace in many situations vla-get-* and vla-put-* (and are sometimes more powerfull).
From this I understand that methods and reactors can not be used.
GetPropertyValue and SetPropertyValue will certainly ease the task, thanks!
If I may be so nosey -- why do you need to do this?
It might sound stupid, but I wanted to replicate a situation to see how a code runs without ActiveX.
Simply refrain from evaluating (vl-load-com) in the first place...
I mean thats the problem, my AutoCAD automatically loads acad.lsp, from where like 300 .lsp files, so I can't trace every lsp file that uses (vl-load-com).
Alternative question would be: is there an easy way to prevent this, without messing up my own settings?
-
I mean thats the problem, my AutoCAD automatically loads acad.lsp, from where like 300 .lsp files, so I can't trace every lsp file that uses (vl-load-com).
Alternative question would be: is there an easy way to prevent this, without messing up my own settings?
Temporarily rename the acad.lsp/acaddoc.lsp files.
-
Don't try this at home kids.
(defun vl-unload-com ( )
;; Untested, quick and dirty, abuse to suit.
;;
;; Note: Subsequent vl-load-com call won't restore former functionality.
(mapcar
(function (lambda (a) (set a nil)))
(vl-remove-if-not
(function (lambda (a) (wcmatch (strcase (vl-symbol-name a)) "VLAX-*,VLA-*,VLR-*")))
(atoms-family 0)
)
)
(princ "\nPoof: Now you're as dumb as a f'ing mac.")
(princ)
)
Added : VLR-*
-
Don't try this at home kids.
..
(princ "\nNow you're as dumb as a f'ing mac.")
..
;D
-
Unfortunately I think that all newer ACAD releases have somewhere (vl-load-com) added inside startup autoload procedures and even until now I haven't figured out where is that initiated... I am though completely sure that this is the case as I have bunch of lisps also autoloaded inside lower releases A2010- and when I type (vlax-get-acad-object) it returns no function definition error message... This is how I check weather my lisps are written like I wanted ((vl-load-com) is specified inside defined lisp command function in all lisps where extensions are needed for correct functionality)...
@MP - you forgot ab VLR-* functions...
-
Don't try this at home kids.
(defun vl-unload-com ( )
;; Untested, quick and dirty, abuse to suit.
;;
;; Note: Subsequent vl-load-com call won't restore former functionality.
(mapcar
(function (lambda (a) (set a nil)))
(vl-remove-if-not
(function (lambda (a) (wcmatch (strcase (vl-symbol-name a)) "VLAX-*,VLA`-*")))
(atoms-family 0)
)
)
(princ "\nNow you're as dumb as a f'ing mac.")
(princ)
)
M.Puckett, this is awesome! :yay!:
I'm left with the impression that you've wrote many awesome stuff, and I like your sense of humour.
-
(1) M.Puckett, this is awesome! :yay!: (2) I'm left with the impression that you've wrote many awesome stuff, and (3) I like your sense of humour.
(1) Thank you QE, (2) Possibly true tho none of it's on-line and (3) lol, you're now a member of a very small group. :-D