Author Topic: There's got to be a better way  (Read 10666 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: There's got to be a better way
« Reply #30 on: April 06, 2006, 04:13:54 PM »
Thats because recursion is alot easier to follow. I cant rember anything beiond `car' and `cdr'. Seriously! If I am forced to use anything beiond that, I use `nth'.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

SMadsen

  • Guest
Re: There's got to be a better way
« Reply #31 on: April 07, 2006, 06:18:46 AM »
Code: [Select]
(setq lst nil)
(while (setq item (tblnext "LAYER" (not item)))
  (setq lst (cons (list (cdadr item) (cdar (cdddr item)) (cdadr (cdddr item))) lst)))

Rev = correction, forgot the first layer... one more time.... another change made... Hey.... I think I need the new lisp book by Mark soon!!!!!

... and when Adesk decides to include truecolor codes in the TBLxxx return values? No big deal, I know, but I prefer ASSOC over fixed positions
  :angel:

CADaver

  • Guest
Re: There's got to be a better way
« Reply #32 on: April 07, 2006, 09:45:45 AM »
ouch, my head hurts...
....what does an aneurysm feel like??   :doa:

LE

  • Guest
Re: There's got to be a better way
« Reply #33 on: April 07, 2006, 10:36:57 AM »
... and when Adesk decides to include truecolor codes in the TBLxxx return values? No big deal, I know, but I prefer ASSOC over fixed positions

yep it is just another way.... do you think they will do any improvement or addition to autolisp/visuallisp?.... according to Peter Funk from adesk lisp is just in maintenance mode... no plans to add any mayor additions.

 :-)


SMadsen

  • Guest
Re: There's got to be a better way
« Reply #34 on: April 07, 2006, 03:39:39 PM »
do you think they will do any improvement or addition to autolisp/visuallisp?
No way they'll improve or add to it. Just being an old conservative fart here  :wink:

Andrea

  • Water Moccasin
  • Posts: 2372
Re: There's got to be a better way
« Reply #35 on: April 07, 2006, 10:20:05 PM »
not elegant....
but work...


Code: [Select]
(defun fortry (/ list1)
(foreach n (ai_table "layer" 0)
(setq list1
       (append list1 (list (list n
       (cdr (assoc 70 (entget (tblobjname "layer" n))))
       (cdr (assoc 290 (entget (tblobjname "layer" n))))
       (cdr (assoc 6 (entget (tblobjname "layer" n))))
       (cdr (assoc 62 (entget (tblobjname "layer" n))))
))))))
Keep smile...