- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've been hitting a wall for a while and can't seem to wrap my cognition around the examples available on the net...
How should a list of lists be created with autolisp? Eg. if i have a list of coordinates, how do i add new coordinates to that list?
Below is a basic example with coordinates. The goal would be to get a new list of lists, with only certain instances of the original list...
I've tried cons and append, but there something funky with my syntax, because I cant seem to get a list of lists, but something else. Also when I'm looping with foreach and try to add the "looping" entity to the list I can't seem to get the list values of the "looping entity" to be added but rather the name of the "looping entity"... in the example that would be "point"...
Any help is greatly appreciated 😃
- F
PS. the example is just a easy case example. To create a list of coordinates is not my actual goal...
(setq Coords (List '(123 -50 10) '(124 50 -13) '(223 -150 120) '(123 -1.50 -10) ) (setq CoordsBelowZero '()) (foreach point Coords (setq z (nth 2 point)) (if (< z 0) (setq CoordsBelowZero '(CoordsBelowZero point)
;how should a list of list be expanded or created? ) )
;goal: ((123 -1.50 -10) (124 50 -13))
Solved! Go to Solution.