Author Topic: Lisp to replace Dataextraction  (Read 9329 times)

0 Members and 1 Guest are viewing this topic.

Red Nova

  • Newt
  • Posts: 69
Re: Lisp to replace Dataextraction
« Reply #30 on: October 02, 2016, 01:59:21 PM »
Thanks. It works. Just added list before rtos to eliminate the point in between. :)

Code - Auto/Visual Lisp: [Select]
  1.     (defun f ( a b / c )
  2.         (if a
  3.             (if (setq c (assoc (caar a) b))
  4.                 (cons (cons (caar a) (list (rtos (- (distof (cadar a)) (distof (cadr c))) 2 0))) (f (cdr a) b))
  5.                 (cons (car a) (f (cdr a) b))
  6.             )
  7.         )
  8.     )

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Lisp to replace Dataextraction
« Reply #31 on: October 02, 2016, 02:31:10 PM »
Thanks. It works. Just added list before rtos to eliminate the point in between. :)

Sorry, I had overlooked the fact you were not using dotted pairs - I have updated the two posts above (simply change cons to list when constructing the list elements).