TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: JohnK on March 02, 2006, 04:48:54 PM

Title: What "function" are you working on now?
Post by: JohnK on March 02, 2006, 04:48:54 PM
I spend alot of time working on / studing " simple " procedures/functions till I find their true identy. Yesterday and today I spent quite a bit of time studing the use of unnamed vs named procedures inside a main procedure. (Namely ``lambda'' vs ``defun'') Tomorow I think I will try to tackle ``eval'' and ``apply'' and how they work. (More specificaly, how symbols and expressions are evaluated.)
Title: Re: What "function" are you working on now?
Post by: Keith™ on March 02, 2006, 05:01:41 PM
data import/export function for traffic engineering
Title: Re: What "function" are you working on now?
Post by: TimSpangler on March 02, 2006, 05:16:55 PM
Saving selections sets across drawing sessions.  Making them avalible for use days later (forever if need be).  It is also a learning episode, dictionaries, xrecord storage/ retrieval etc.
Title: Re: What "function" are you working on now?
Post by: Kerry on March 02, 2006, 05:22:48 PM
I thought the question was rhetorical ..

but, OK ;

Validating XRecord Data against a DataBase.
Title: Re: What "function" are you working on now?
Post by: MP on March 02, 2006, 05:29:05 PM
More than I can list, but the two front burner items are: Application that prioritizes select windows processes for client #1 and writing a Plant Software Selection and Implementation Plan for client #2.
Title: Re: What "function" are you working on now?
Post by: hendie on March 03, 2006, 03:47:43 AM
data import/export function for traffic engineering and keeping Keith on the right track  :lol:
Title: Re: What "function" are you working on now?
Post by: Jürg Menzi on March 03, 2006, 05:08:57 AM
Title: Re: What "function" are you working on now?
Post by: ElpanovEvgeniy on March 03, 2006, 07:55:17 AM
>Se7en

I think, after translation, these functions are identical!
Code: [Select]
(mapcar '1+ lst)

(defun rec_1+ (lst)
  (if lst
    (cons (1+ (car lst))
      (rec_1+ (cdr lst))
    ) ;_  cons
  ) ;_  if
)
Title: Re: What "function" are you working on now?
Post by: JohnK on March 03, 2006, 09:48:58 AM
>Se7en

I think, after translation, these functions are identical!
Code: [Select]
(mapcar '1+ lst)

(defun rec_1+ (lst)
  (if lst
    (cons (1+ (car lst))
      (rec_1+ (cdr lst))
    ) ;_  cons
  ) ;_  if
)

Yes, that is my understanding too.
Title: Re: What "function" are you working on now?
Post by: LE on March 03, 2006, 11:42:34 AM
I am getting back into the geometry world, to update one of my apps, to have some more abilities, first to get the calculation of the centroid/geometric center, implementation of a hoover alike [there is one class AcEdInputPointMonitor but does not work for what I need], I need to have all the closed polylines, one into each other and pass, the cursor and while is inside of the polyline, to provide the appropriate information, or to open an excel or table object and have that info/properties available... among other things...

le.
Title: Re: What "function" are you working on now?
Post by: Jim Yadon on March 04, 2006, 12:55:08 PM
A complete rewrite of all the tools I wrote in LISP so long ago. Namely to add variables where I have constants to allow for user level control of certain functions. As well as build in a few more error traps. With that in mind, what is the preferred method of long term variable storage among you all?
Title: Re: What "function" are you working on now?
Post by: ElpanovEvgeniy on March 04, 2006, 02:03:16 PM
Excuse! I - not correctly interpreted title of a subject. (What "function" are you working on now?)
my work - optimal cutting...
http://www.rusparquet.com/
Title: Re: What "function" are you working on now?
Post by: David Bethel on March 04, 2006, 03:35:43 PM
As to (eval) and (apply), these are pretty much interchangeable calls:

Code: [Select]
   (apply '+ '(2 3 4))

   (eval (cons '+ '(2 3 4)))


It also works well with 'min 'max as well as the basic math functions.

My latest attempt, not my first at it and still not comprhending is the (boole) function.  -David

Title: Re: What "function" are you working on now?
Post by: CADaver on March 05, 2006, 02:06:13 PM
just getting a little time to clean up old functions
Title: Re: What "function" are you working on now?
Post by: JohnK on March 28, 2006, 09:49:58 AM
As to (eval) and (apply), these are pretty much interchangeable calls:

Code: [Select]
   (apply '+ '(2 3 4))

   (eval (cons '+ '(2 3 4)))


It also works well with 'min 'max as well as the basic math functions.

My latest attempt, not my first at it and still not comprhending is the (boole) function.  -David

David, have you read Stigs paper on binary and autocad. I think it will give you some great ideas with Boole.
Title: Re: What "function" are you working on now?
Post by: RbtDanforth on March 28, 2006, 09:02:48 PM
Long ago when lisp would not survive a plot, much less from drawing to drawing, I had it write little ASCII files ie. data.asc where the first line was variable a the next b etc.

It would them write a script that would plot the drawing and go to the next drawing in a list that was saved on another ASCII file, the script was then set to load and run the lisp function that would write another script file etc.

Since it always overwrote the previous information there was not a clutter of little ASCII files, and if it crashed, the last ASCII file could take over where things were left off. I also had an ASCII file with the standard info that went on the border so that was updated correctly in the process. In those days I could plot a hundred drawings with a single command :-D Changes in the way Autocad works has made that system a buggy whip, but it was fun while it lasted.

I did use that system to extract or fill out Bill of Materials lists and to hunt for specific elevation  blocks by picking the text of their number on the plan. By using space delimited text files it was simple to grab the line of text and pick out the text from point a to b.

To store info in a drawing, an invisible block with invisible attributes works pretty well as long as the info is well defined and hopefully short. I suppose there are more elegant ways but that would be my quick and dirty style.

As for my current problems, I am trying to do a workaround for a Mtext wipeout bug. Instead of hiding what is behind it creates a dark box of its own ( not the #63 color) hiding the text. A bit of experimenting shows up a set of codes that read when the wipeout is on but not when the wipeout is off. Now I have #s 45 and 63 understood but 90, 421, and 441 are a bit confusing.

If I set 90 to 2, the messed up text, the problem (and the wipeout) goes away, at 1 it goes to color stored in #63 and whether messed up of not 90 seems to be set at 3 when ever by background is set. Autocad doesn't seem to accept 0 or any number higher than 3.

When set at 2 the Assoc's 45, 63, 90, 421, & 441 still show which tells me that 2 is not a right setting. If someone has a solution that will quickly solve the problem, I would like to here it.