Hi All,
Is there any way to find the path of current lisp file. For example,If we located test.lsp file on C driver, the function will return "C:\test.lsp".etc...
Thanks for any help.
What do you mean by 'current lisp file'?
(findfile "yourfile.lsp") in autocad will return the location of "yourfile" within the autocad search paths, if it exists...
hopefully that helps
Thanks for reply. But I want to find the saved path of lisp file being edited. I want to load other file in same folder which located anywhere.Maybe it's not loacted in Autocad search path.
There may be a way to retrieve the "last opened file" location from a registery entry somewhere? I only have LT at the moment, so I can't help you with the actual entry.
This is the folder for recent files in 2010 LT. May or may not help you...
HKEY_CURRENT_USER\Software\Autodesk\AutoCAD LT\R15\ACADLT-8001:409\Recent File List
HTH
@ditran wrote:I want to find the saved path of lisp file being edited.
If you are referring to a LISP file that is being edited within the Visual LISP IDE, you could read the *edit-file-history* section of the VLIDE.DSK file.
Hello, have you find athe solution.
i am also looking for it.
if you found a solution can you mail me?
email: wdwolff@planet.nl
@wdwolff1 hi,
i googled and the only solution i found for knowing the full path of lisp file comes from dos_lib.
1. install >> mcneel doslib << on your autocad
2. on each source lisp file set an id something like (setq MY_LISP_ID "MyLispID.lsp")
3 . call the following nice function.
be aware for the file type. if you are compiling the lsp to fas or vlx.
also note there could be 2 lsp files with the same name coming from different folders.
enjoy
Moshe
(defun get_fullpath_lispname (fname / modula)
(cond
; make sure doslib is loaded
((null (member (setq modula (strcat "doslib" (substr (getvar "acadver") 1 2) "x64.arx")) (arx))
(prompt (strcat "\n" modula " is not loaded."))
); case
((vl-some
(function
(lambda (fpath)
(if (eq (strcase (strcat (vl-filename-base fpath) (vl-filename-extension fpath))) (strcase fname)) fpath)
)
)
(dos_lisplist t)
)
); case
); cond
); get_fullpath_lispname
I'm sorry, but as I recall there is no way using AutoLisp to find the path of a loaded lisp file.
Owen Wengerd (Manusoft) used to provide us a VLXLOAD.arx to snag the name/path of a VLX file when it's loaded but I don't know if he has provided same for newer releases (since about 2006).
John F. Uhden