Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
how to check current running lisp is loaded from which drive and folder ?
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: how to check current running lisp is loaded from which drive and folder ? (Read 1382 times)
0 Members and 1 Guest are viewing this topic.
CatDance
Newt
Posts: 57
how to check current running lisp is loaded from which drive and folder ?
«
on:
September 08, 2021, 02:27:07 AM »
Example if I loaded a lisp using appload to load it,
when that lisp is running, how to check where it is loaded from ?
Thanks.
Logged
A must-read book: Amazing story how Bill + Paul started Microsoft and history of computer revolution.
https://www.amazon.com/Hard-Drive-Making-Microsoft-Empire/dp/0887306292
Brief history of Microsoft
https://www.youtube.com/watch?v=BLaMbaVT22E
baitang36
Bull Frog
Posts: 213
Re: how to check current running lisp is loaded from which drive and folder ?
«
Reply #1 on:
September 08, 2021, 07:34:57 AM »
(defun c:tt ()
(setq
nice_path (vl-registry-read
(strcat "HKEY_CURRENT_USER\"
(vlax-product-key)
"\\Profiles\"
(vla-get-activeprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))))
"\\Dialogs\\Appload"
)
"MainDialog"
)
nice_path (strcat nice_path ";" nice_path "nice\\support")
)
)
Logged
baitang36
Bull Frog
Posts: 213
Re: how to check current running lisp is loaded from which drive and folder ?
«
Reply #2 on:
September 08, 2021, 07:43:11 AM »
(defun GetLspPath()
(setq lsppath
(vl-registry-read
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\lsp"
(substr
(vl-registry-read
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\lsp"
"MRUList"
)
1
1
)
)
)
(setenv "ACAD" (strcat (getenv "ACAD") ";" (vl-filename-directory lsppath)))
)
Logged
Grrr1337
Swamp Rat
Posts: 812
WWW
Re: how to check current running lisp is loaded from which drive and folder ?
«
Reply #3 on:
September 14, 2021, 04:01:02 AM »
I've examined baitang36's code and this seems to work for finding the directory's path:
Code - Auto/Visual Lisp:
[Select]
; (GetLastApploadedLispPath)
(
defun
GetLastApploadedLispPath
(
)
(
vl
-
registry
-
read
(
strcat
"HKEY_CURRENT_USER
\\
"
(
vlax-product-key
)
"
\\
Profiles
\\
"
(
vla-get-activeprofile
(
vla-get-Profiles
(
vla-get-Preferences
(
vlax-get-acad-object
)
)
)
)
"
\\
Dialogs
\\
Appload"
)
; strcat
"MainDialog"
)
; vl-registry-read
)
; defun
Code - Auto/Visual Lisp:
[Select]
_$
(
GetLastApploadedLispPath
)
"D:
\\
CODE STUFF
\\
LISP
\\
Potentially USED LISPs
\\
Curves
\\
"
But unfortunately I don't have "MRUList" registry, but "MRUListEx" instead, hence:
Code - Auto/Visual Lisp:
[Select]
_$
(
vl
-
registry
-
read
"HKEY_CURRENT_USER
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
ComDlg32
\\
OpenSavePidlMRU
\\
lsp"
"MRUListEx"
)
>>
(
3
)
and
Code - Auto/Visual Lisp:
[Select]
_$
(
vl
-
registry
-
read
"HKEY_CURRENT_USER
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
ComDlg32
\\
OpenSaveMRU
\\
lsp"
(
itoa
(
car
(
vl
-
registry
-
read
"HKEY_CURRENT_USER
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
ComDlg32
\\
OpenSavePidlMRU
\\
lsp"
"MRUListEx"
)
)
)
)
>>
nil
Doesn't seem to work.
Logged
(apply ''((a b c)(a b c))
'(
(( f L ) (apply 'strcat (f L)))
(( L ) (if L (cons (chr (car L)) (f (cdr L)))))
(72 101 108 108 111 32 87 111 114 108 100)
)
)
vevo.bg
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
how to check current running lisp is loaded from which drive and folder ?