Jump to content

A Tool to search Autolisp Functions, by description.


harilalmn

Recommended Posts

Hi All,

It has been a very short while since I put my hands on AutoLISP. Learning and moving forward, it has been becoming my craze to smoke my brain out on writing routines. As a result my sleep got cut down to 3-4 Hrs..!!! :shock:

 

Well... To help myself out, today I compiled almost all functions (?) in Autolisp and made a notepad database. Then I wrote a small vb script to search functions and their descriptions in this database. I thought of sharing it here with you guys.... May be very much amateur... Still I hope it would help someone...

 

I have attached the two files; the vbscript and the database in txt format; as a zip file.

For the program to work, you should have both the files saved in same location.

 

You can either search a function by entering the description, or vice versa...

Autolisp_Functions_Search.zip

Edited by harilalmn
Link to comment
Share on other sites

That was probably a lot of copy-n-pasting! It would be nice to use such directly in VLIDE. At present you can type Ctrl+F1 while the cursor is on the function name and then the help page would open. Searching through the description is still a hassle as ADesk's "on-line" help search is still a mess: I prefer just doing a google instead - usually gets a lot better results.

 

It would be nice to have yours link to the help as well. Or have some option to place the function name in clipboard so you can paste into VLIDE. The dialog doesn't allow you to select text to copy. BTW, here's the same thing as your VBS but in Lisp:

(vl-load-com)

(defun c:SearchAutolispFunction (/ fn f str lst)
 (if (and (setq fn (findfile "Autolisp_Functions.txt"))
          (setq f (open fn "r"))
     )
   (progn
     (while (setq str (read-line f))
       (setq lst (cons str lst))
     )
     (close f)
     (if lst
       (if (setq str (getstring "Search string: "))
         (alert (apply 'strcat
                       (cons "Found functions:\n"
                             (mapcar
                               '(lambda (item)
                                  (strcat "\n" item)
                                )
                               (acad_strlsort
                                 (vl-remove-if-not
                                   '(lambda (item)
                                      (wcmatch (strcase item) (strcat "*" (strcase str) "*"))
                                    )
                                   lst
                                 )
                               )
                             )
                       )
                )
         )
         (alert "Can't search for nothing.")
       )
       (alert "Nothing in function database.")
     )
   )
   (alert "No function database file found.")
 )
 (princ)
)

Link to comment
Share on other sites

harilalmn,

 

I applaud your efforts to compile such a reference, however, the VLIDE does have all this information directly available, including (for versions

 

Maybe have a look at these short tutorials on the Visual LISP IDE (VLIDE), if you aren't already familiar with it.

Link to comment
Share on other sites

harilalmn,

 

I applaud your efforts to compile such a reference, however, the VLIDE does have all this information directly available, including (for versions

 

Maybe have a look at these short tutorials on the Visual LISP IDE (VLIDE), if you aren't already familiar with it.

balloon_pop.gif.................

Link to comment
Share on other sites

Just trying to save the guy/gal from re-inventing the wheel!

I wasn't fussing at you. I would have said the same thing if I'd gotten to him first.

Link to comment
Share on other sites

Lol... :lol: Thanks for the comments, Seniors...!!!

I believe, "If it eats up too much of time doing something, there is always a better way to do it."

So, now here, I got to know something new.

 

And........ Lee....,

I had never been to lee-mac.com. Thanks a lot for the link. That is really a treasure out there for beginners like me...!!

Link to comment
Share on other sites

And........ Lee....,

I had never been to lee-mac.com. Thanks a lot for the link. That is really a treasure out there for beginners like me...!!

 

Cheers harilalmn :)

 

If you have any questions about any of my tutorials, please do ask :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...