PDA

View Full Version : Autolisp functions traceability



acad.user
2004-11-08, 09:09 PM
Hi everybody,
I wonder if there is any built-in routine in AutoCAD for locating a lisp file from which a function is loaded. I mean, I just want to know a function or a C:XXX command, which is available on current AutoCAD session, is loaded from which lisp file (including the path and file name). If there is no such built-in routine, can anybody help how to identify the file to which a lisp function belongs to?

Thanks in Advance,
Abdul Huck

kennet.sjoberg
2004-11-09, 07:31 AM
Hi Abdul, probably not, I will be surprised if there is.

: ) Happy Computing !

kennet

acad.user
2004-11-28, 05:00 AM
Sorry for the late response. I guess this is not available as I got only one response. Thanks Kennet. This requirement may be added to the wish list.

Regards,
Abdul Huck

truevis
2004-11-29, 12:29 AM
About the only thing that can be done is to search your path for *.lsp with the text "defun C:XXX".

Presumably, the .lsp file with the function's definition would be the one loaded.

kennet.sjoberg
2004-11-29, 07:12 AM
Hi truevis, that tells You only if the file exist in your search path,
not where the function is loaded from, You can drag and drop from everywhere.

: ) Happy Computing !

kennet

RobertB
2004-12-03, 06:47 PM
I believe the McNeel's DosLib has a function for that.

kennet.sjoberg
2004-12-04, 09:45 AM
?

No, it must be an impossible task, a loaded function C:XXX do not left any tracks in memory to the file it comes from, and the function and the filename do dot necessarily have the same name as an search option, not even find-in-files is an search option because there may be more than one file including the function, and nothing tells You which file that loaded the function.
Please correct me if I am wrong.

: ) Happy Computing !

kennet

c : x , c:x , c :x , c: x , C:X , C : X , C :X , C: X ,

RobertB
2004-12-07, 01:10 AM
Note that I've never used it, but...

dos_lisplist

--------------------------------------------------------------------------------

Returns a list of loaded AutoLISP/Visual LISP files.

Syntax
(dos_lisplist [T])
Parameters
T
If specified, fully qualified paths are returned. Otherwise, just the filenames are returned.


Returns
A list of string identifying the loaded LISP files if successful.

nil on error.

Example
Command: (dos_lisplist)

("acetutil.fas" "acetauto.LSP" "acettest.fas" "dwfout.lsp" "acad2000.FAS" "acad2000doc.FAS" "acad.mnl" "acetmain.mnl")

Command: (dos_lisplist t)

("C:\\Program Files\\AutoCAD 2002\\express\\acetutil.fas" "C:\\Program Files\\AutoCAD 2002\\express\\acetauto.LSP" "C:\\Program Files\\AutoCAD 2002\\support\\acettest.fas" "C:\\Program Files\\AutoCAD 2002\\support\\legacy\\dwfout\\dwfout.lsp" "C:\\Program Files\\AutoCAD 2002\\support\\acad2000.FAS" "C:\\Program Files\\AutoCAD 2002\\support\\acad2000doc.FAS" "C:\\Program Files\\AutoCAD 2002\\Support\\acad.mnl" "C:\\Program Files\\AutoCAD 2002\\express\\acetmain.mnl")

kennet.sjoberg
2004-12-07, 06:49 AM
Great Robert, I am happy with that !
McNeel's prove that there must be a place there AutoCAD store the path information
and of course an resulting question will be, where ?

: ) Happy Computing !

kennet

RobertB
2004-12-07, 03:05 PM
Must be in ARX somewhere. The LISP/VBA guys are out of luck without DOSLib.

luke.78920
2004-12-08, 03:54 PM
Use Explorer's search function with *.lsp as a file parameter and "defun C:XXX" as a text parameter. If you don't include the "defun" keyword, you'll get every instance that the command is called. Using defun will show where it is defined. I'm not sure if this answers your question, but this is how I find function and command definitions.

kennet.sjoberg
2004-12-08, 10:50 PM
Thank You Luke, but the problem is not to find a text string "C:XXX" in different files
the problem is to inside AutoCAD find the connection between the function C:XXX and the correct corresponding file.

and as RobertB mentioned, it can not be done with Lisp

: ) Happy Computing !

kennet