Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/16/2022 in Posts

  1. No, functions One & Two will only be defined when their respective defun expressions are evaluated, and such defun expressions will only be evaluated when the function Main is evaluated. When loading an AutoLISP file, the contents are merely evaluated as if they were pasted to the command line or console - the interpreter does not 'scan' for nested function definitions - in fact, the interpreter is entirely indifferent to the expressions being evaluated: you could happily load an AutoLISP file containing only princ expressions without defining any functions whatsoever.
    1 point
  2. Another, for any depth of lists - (defun foo ( kys lst ) (defun bar ( kys lst ) (if lst (bar (apply 'append (mapcar '(lambda ( x ) (mapcar '(lambda ( y ) (list (car x) y)) (baz (cadr x) (car lst))) ) kys ) ) (cdr lst) ) kys ) ) (defun baz ( key lst / itm ) (if (setq itm (assoc key lst)) (cons (cadr itm) (baz key (cdr (member itm lst)))) ) ) (bar (mapcar 'list kys kys) lst) ) (setq list1 '(a b c) list2 '((a n1) (c n3) (b n2)) list3 '((n1 m1) (n1 m2) (n1 m3) (n2 m4) (n2 m5) (n3 m6)) list4 '((m1 p1) (m2 p2) (m3 p3) (m4 p4) (m5 p5) (m6 p6)) ) _$ (foo list1 (list list2 list3 list4)) ((A P1) (A P2) (A P3) (B P4) (B P5) (C P6))
    1 point
  3. (setq List1 '(a b c) list2 '((a n1) (c n3) (b n2)) list3 '((n1 m1) (n1 m2) (n1 m3) (n2 m4) (n2 m5) (n3 m6)) list4 '((m1 p1) (m2 p2) (m3 p3) (m4 p4) (m5 p5) (m6 p6)) ) (mapcar '(lambda (x / y z) (cond ((setq y (cadr (assoc (car x) (mapcar 'reverse list3)))) (cond ((setq z (cadr (assoc y (mapcar 'reverse list2)))) (list z (cadr x)) ) ((list y (cadr x))) ) ) (x) ) ) list4 ) -->((A P1) (A P2) (A P3) (B P4) (B P5) (C P6))
    1 point
  4. In response to your message we have reviewed the project instructions on your student portal and it appears that there is one section that does not display correctly. While a correction is being made I have attached a file which contains the "missing bullet" items showing the distances and bearings required for the last two subdivision boundaries. Please feel free to contact me if you have further questions and keep in mind you can always attach your actual .dwg drawing file in a message for review to make sure you are on the right track. Sincerely, Jon D. Instructor 4 main subdivision boundaries.pdf
    1 point
×
×
  • Create New...