Author Topic: Lisp Library  (Read 3262 times)

0 Members and 1 Guest are viewing this topic.

SPDCad

  • Bull Frog
  • Posts: 453
Lisp Library
« on: November 24, 2004, 01:02:43 AM »
I was wondering if any one else has built a lisp command library:?:.

What I mean by lisp command library is a lisp which is coded to do a specific task, and you then treat that lisp like it is a lisp command.
I load my library lisps at start and I then have the lisps available when coding up other lisps

A few examples are the following.

(R2D ARG) = Radians to Degrees
(D2R ARG)= Degrees to Radians
(DXF CODE LIST) =  Return co-rosponding dxf vale for DXF code entered
(DLGload FILENAME) = load a DCL dialog box complete with error checking
(TOlist LIST KEY) = Send a list to the listbox in dcl
(LIST2STR LIST) = Converts a list to a string
(LIST2FILE LIST FILENAME) = Writes a list to a ascii text file
(FILE2LIST FILENAME) = Read a ascii text file and converts it to a list
(PATHSTRIP FILENAME) = Strips the path from a file
(ROUND ARG NEAREST DIRECTION) = Rounds a real number up, or down to a value to specifiy
(RANDOM) = Returns  a random number
(REVERSETEXT STR) = Reverses a text string
....etc

I am hoping to consolidate my complete list of xtra commands and post them.

I am interested in seeing anyone elses library.

 :D
AutoCAD 2010, w/ OpenDCL

visit: http://reachme.at/spd_designs

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Lisp Library
« Reply #1 on: November 24, 2004, 02:10:32 AM »
I've written my own main function, command and dcl libraries, but they're not available for public consumption, sorry. I'd list the functions etc. but it's a rather large list (around 3200) and I really don't feel that ambitious. I do have them broken into categories like numerical, string, list, tables, xdata, dictionaries, activex, objectdbx, dcl etc. if that's illuminating at all.

Weird thing is, lately Ive been writing a lot of apps that need to be fully self reliant, so I've been using the libraries less and less, though they are the cornerstone of our standard CADD builds (everyone loads my libraries at startup from the network) and I don't seee that changing that soon.

Rambling so, it must be bed time ... Zzz.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Lisp Library
« Reply #2 on: November 24, 2004, 07:59:17 AM »
SPDcad,
I would love to get a look at your library. I am not that organized and usually
write stand alone routines. Mark has a library of routines posted somewhere here
but I can't put my finger on the link.  There are several web sites as you must have
seen with libraries. One method that I saw for organizing used a two letter prefix
to organize the routines. Here is that link www.4d-technologies.com  
Here is another one http://www.menziengineering.ch/ click on Free Stuff
Also David has some nice routines too :  http://www.davidbethel.com/lisp/
I have lots of routines but are not very well organized. MP how do you keep up with
that many routines & how do you find the one you need when you need it?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

SPDCad

  • Bull Frog
  • Posts: 453
Lisp Library
« Reply #3 on: November 24, 2004, 10:24:40 AM »
Quote from: MP
I do have them broken into categories like numerical, string, list, tables, xdata, dictionaries, activex, objectdbx, dcl etc. if that's illuminating at all.


Now I know how you come up with lisp examples for this forum so quickly. :)

Like MP mentioned most of the code for the lisp functions will be unavailable to the public, but I am willing to distribute a list of functions and what they do.  If you would like to see how I handled a function I maybe willing to send you the code by email.

I organize my functions code so that they all start with SPDx. (ie. SPDxR2D) that way I know that the command is a global function and part of the library. I have also written a lisp that will read lisp source code and append the global functions to the lisp before I compile the final lisp.  This way I can make stand alone programmes that can be easily distributed.

Some of my SPDx function have become standard lisp functions to me and I couldn’t write lisp with out them.
AutoCAD 2010, w/ OpenDCL

visit: http://reachme.at/spd_designs

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Lisp Library
« Reply #4 on: November 24, 2004, 10:33:08 AM »
CAB -
That's exactly what this would be good for. :D
http://tinyurl.com/3tavd

Now if I can just get access to this from here I'd be in heaven.
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Lisp Library
« Reply #5 on: November 24, 2004, 10:45:16 AM »
Quote from: CAB
MP how do you keep up with
that many routines & how do you find the one you need when you need it?

I use a (now defunct) hierarchical text editor (ScopeEdit) that allows me to arrange arbitrary trees, kind of like the explorer paradigm. Each node corresponds to a function, individual nodes may be under parent nodes comprising areas, like string, list, numerical etc. It's very combersome to to manage libraries this large any other way in my experience. To that end I've started coding my own editor to replace ScopeEdit.

Quote from: SPDCad
Now I know how you come up with lisp examples for this forum so quickly. :)

Hate to dissappoint you, but 99% of the code I post to the swamp is off the top of my head. Of course, after authoring as much code as I have (not bragging, just being being factual) writing code is second nature.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst