Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm a beginner!
I'm multiplying and summing block attributes from a list.
somaml 0
60 x 2 = 120
somaml 120
320 x 4 = 1280
somaml 1400
170 x 9 = 1530
somaml = 2930
.
.
n
; error: too few arguments
(defun c:teste()
(setq somaml 0)
(setq lst (list "L1 60 2" "L2 320 4" "L3 170 9"))
(foreach lst
(setq somaml (+ (mapcar (function (lambda (x y) (* atoi (nth 1 x) atoi (nth 2 y)))) lst) somaml))
)
(princ somaml)
)
Solved! Go to Solution.