Comprehensive list of Lisp functions?

Discussion in 'AutoCAD' started by jongor, Jan 13, 2005.

  1. jongor

    jongor Guest

    Does anyone know where I might find this?

    How can I use a function if I don't know it exists? I need a list of all the lisp functions......

    Thanks!
     
    jongor, Jan 13, 2005
    #1
  2. Hi,

    Why not look at the help files? That's what there are there for.

    --

    Regards,


    Laurie Comerford
    www.cadapps.com.au
     
    Laurie Comerford, Jan 13, 2005
    #2
  3. jongor

    Doug Broad Guest

    So what's wrong with using help in vlide? Knowing the name of
    all the functions is about as useless as knowing all the words in the
    english language without knowing their meaning or appropriate context.
    There are good manuals provided with ACAD.

    Try (atoms-family 1)
     
    Doug Broad, Jan 13, 2005
    #3
  4. jongor

    T.Willey Guest

    Here is one I use.

    Tim

    (defun c:GetLispList (/ DirPath LspList FileName FullPath OpndFile LineTxt FuncList
    FullList TxtFile temp1 temp2)

    (command "_.cmdecho" (getvar "cmdecho"))
    (if (setq DirPath (DIRECTORY-DIA))
    (progn
    (setq LspList (vl-directory-files DirPath "*.lsp"))
    (setq LspList (vl-sort LspList '(lambda (x y) (< (strcase x) (strcase y)))))
    (foreach item LspList
    (setq FileName item)
    (setq FullPath (strcat DirPath item))
    (setq OpndFile (open FullPath "r"))
    (while (setq LineTxt (read-line OpndFile))
    (if
    (and
    (setq temp1 (vl-string-search "DEFUN C:" (strcase LineTxt)))
    (setq temp2 (vl-string-search "\(" LineTxt))
    (> temp1 temp2)
    )
    (progn
    (setq temp1 (substr LineTxt (+ 9 temp1)))
    (setq temp2 (vl-string-search "\(" temp1))
    (setq FuncList (cons (substr temp1 1 temp2) FuncList))
    )
    )
    )
    (close OpndFile)
    (setq FuncList (vl-sort FuncList '<))
    (setq FullList (cons (list FileName FuncList (GetSubFuncs FullPath)) FullList))
    (setq FuncList nil)
    )
    )
    )
    (setq TxtFile (strcat DirPath "Lisp-List.txt"))
    (setq OpndFile (open TxtFile "w"))
    (foreach item (reverse FullList)
    (write-line (strcat "--Lisp file name - " (car item)) OpndFile)
    (write-line "" OpndFile)
    (foreach item2 (cadr item)
    (write-line (strcat " Function name - " item2) OpndFile)
    )
    (write-line "" OpndFile)
    (if (caddr item)
    (foreach item2 (caddr item)
    (write-line (strcat " Sub-Function name - " item2) OpndFile)
    )
    )
    (write-line "" OpndFile)
    )
    (close OpndFile)
    (prompt (strcat "\n Log file location \"" TxtFile"\"."))
    (princ)
    )

    ;---------------------------

    (defun GetSubFuncs (LispFile / SubFuncList OpndFile temp1 temp2 temp3)

    (setq OpndFile (open LispFile "r"))
    (while (setq temp1 (read-line OpndFile))
    (if
    (and
    (setq temp2 (vl-string-search "DEFUN" (strcase temp1)))
    (setq temp3 (vl-string-search "\(" temp1))
    (> temp2 temp3)
    (not (vl-string-search "C:" (strcase temp1)))
    )
    (progn
    (setq temp2 (substr temp1 (+ 7 temp2)))
    (setq temp1 (vl-string-search "\(" temp2))
    (setq SubFuncList (cons (substr temp2 1 temp1) SubFuncList))
    )
    )
    )
    (close OpndFile)
    (vl-sort SubFuncList '<)
    )

    (defun Directory-Dia ( / sh folder folderobject result)
    ;; By Tony Tanzillo
    ;; Modified by Tim Willey

    (vl-load-com)
    (setq sh
    (vla-getInterfaceObject
    (vlax-get-acad-object)
    "Shell.Application"
    )
    )


    (setq folder
    (vlax-invoke-method
    sh
    'BrowseForFolder
    0
    ""
    0
    )
    )
    (vlax-release-object sh)


    (if folder
    (progn
    (setq folderobject
    (vlax-get-property folder 'Self)
    )
    (setq result
    (vlax-get-property FolderObject 'Path)
    )
    (vlax-release-object folder)
    (vlax-release-object FolderObject)
    (if (/= (substr result (strlen result)) "\\")
    (setq result (strcat result "\\"))
    result
    )
    )
    )
    )
     
    T.Willey, Jan 13, 2005
    #4
  5. jongor

    T.Willey Guest

    Oops. Mine is to get lisp functions and sub-functions, not functions to use within a lisp routine. My mistake.

    Tim
     
    T.Willey, Jan 13, 2005
    #5
  6. jongor

    Don Butler Guest

    You need to be a little more descriptive. Do you mean "Native" VisualLisp
    functions or "Custom" functions that you have defined?

    Don
     
    Don Butler, Jan 13, 2005
    #6
  7. jongor

    GaryDF Guest

    Check out the following:
    LSPDATA.lsp - Express Tool data for lsp command

    Gary
     
    GaryDF, Jan 14, 2005
    #7
  8. jongor

    jongor Guest

    What's native Visual Lisp?

    I've created a custom lisp file in a text editor that I load with Appload.

    What's Vlide help?

    I've searched the Autocad help and found almost nothing on Lisp programming.

    Are there any books that anyone could recommend for customization using LISP?

    thanks
     
    jongor, Jan 14, 2005
    #8
  9. jongor

    Jay Guest

    Visual LISP interactive development environment (IDE) type VLIDE at the commnad prompt. What version do you have?
     
    Jay, Jan 14, 2005
    #9
  10. jongor

    Don Butler Guest

    jongor,

    That then is a custom function. If your function is a command, i.e. "(defun
    c:MyFunction ()"...

    then use...

    (if (and c:MyFunction (eq (type c:MyFunction) 'SUBR)) dosomething
    dosomethingelse)

    or...

    (if (and MyFunction (eq (type MyFunction) 'SUBR)) dosomething
    dosomethingelse)

    This IF expression tests whether the variable has been defined AND whether
    it is a SubRoutine.

    If it is a SUBR, it evaluates the "dosomething" argument. If it isn't, it
    evaluates the "dosomethingelse" argument.

    Don
     
    Don Butler, Jan 16, 2005
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.