Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/12/2020 in all areas

  1. The duplicate elements present in each list make this task slightly trickier than it would otherwise be - here is an alternative solution: (defun f ( a b ) (mapcar '(lambda ( x / z ) (setq z b) (list x (foreach y x (setq z (LM:removeonce y z)))) ) a ) ) (defun LM:removeonce ( x l / f ) (setq f equal) (vl-remove-if '(lambda ( a ) (if (f a x) (setq f (lambda ( a b ) nil)))) l) ) _$ (f a b) ( ((750.0 500.0 500.0) (400.0)) ((750.0 500.0 400.0) (500.0)) ((750.0 500.0 400.0) (500.0)) ((500.0 500.0 400.0) (750.0)) ((750.0 500.0) (500.0 400.0)) ((750.0 500.0) (500.0 400.0)) ((750.0 400.0) (500.0 500.0)) ((500.0 500.0) (750.0 400.0)) ((500.0 400.0) (750.0 500.0)) ((500.0 400.0) (750.0 500.0)) ((750.0) (500.0 500.0 400.0)) ((500.0) (750.0 500.0 400.0)) ((500.0) (750.0 500.0 400.0)) ((400.0) (750.0 500.0 500.0)) )
    2 points
  2. I have never used Civil3d, but this sounds just like the Option shown in this screenshot, may or may not be the same, but worth a shot. Hopefully that will help you. Priority for Coordinate Data Entry, take your pick. The Variable name is OSNAPCOORD, as shown in the second screenshot, at least it is in AutoCad Vanilla.. If you are still having issues with it, you might need to turn off your AutoSnap Magnet
    1 point
  3. (defun t1 ( / A B) (setq A '((750.0 500.0 500.0)(750.0 500.0 400.0)(750.0 500.0 400.0)(500.0 500.0 400.0)(750.0 500.0) (750.0 500.0)(750.0 400.0)(500.0 500.0)(500.0 400.0)(500.0 400.0)(750.0)(500.0)(500.0)(400.0))) (setq B '(750.0 500.0 500.0 400.0)) (mapcar '(lambda (x) (cons x (list (f2 x B)))) A)) (defun t2 ( / A B) (setq A '((100.0 100.0 100.0)(200.0 100.0)(200.0 100.0)(200.0 100.0) (100.0 100.0)(100.0 100.0)(100.0 100.0)(200.0)(100.0)(100.0)(100.0))) (setq B (list 200.0 100.0 100.0 100.0)) (mapcar '(lambda (x) (cons x (list (f2 x B)))) A)) ; stolen from Master Lee LM:SubstOnce -> (f1 "A" 1 '(1 1 2)) -> ("A" 1 2) (defun f1 (a b l)(mapcar '(lambda (x)(if (equal b x)(setq x a a nil b nil)) x) l)) ;;; (f2 '(750.0 500.0 500.0) '(750.0 500.0 500.0 400.0)) -> (400.0) (defun f2 ( x y )(mapcar '(lambda (z)(setq y (f1 nil z y))) x)(vl-remove nil y)) ; print list (test function) (defun prl (lst)(mapcar '(lambda(x)(princ "\n")(princ x)) lst)) (setq C1 (t1) C2 (t2)) ;;; show result in dialog (alert (strcat "C1 :\n" (vl-princ-to-string C1) "\n\nC2 :\n" (vl-princ-to-string C2))) ;;; or show result as lists (princ "\n\nC1 :")(prl C1)(princ "\n\nC2 :")(prl C2) ;| C1 : ((750.0 500.0 500.0) (400.0)) ((750.0 500.0 400.0) (500.0)) ((750.0 500.0 400.0) (500.0)) ((500.0 500.0 400.0) (750.0)) ((750.0 500.0) (500.0 400.0)) ((750.0 500.0) (500.0 400.0)) ((750.0 400.0) (500.0 500.0)) ((500.0 500.0) (750.0 400.0)) ((500.0 400.0) (750.0 500.0)) ((500.0 400.0) (750.0 500.0)) ((750.0) (500.0 500.0 400.0)) ((500.0) (750.0 500.0 400.0)) ((500.0) (750.0 500.0 400.0)) ((400.0) (750.0 500.0 500.0)) C2 : ((100.0 100.0 100.0) (200.0)) ((200.0 100.0) (100.0 100.0)) ((200.0 100.0) (100.0 100.0)) ((200.0 100.0) (100.0 100.0)) ((100.0 100.0) (200.0 100.0)) ((100.0 100.0) (200.0 100.0)) ((100.0 100.0) (200.0 100.0)) ((200.0) (100.0 100.0 100.0)) ((100.0) (200.0 100.0 100.0)) ((100.0) (200.0 100.0 100.0)) ((100.0) (200.0 100.0 100.0)) |;
    1 point
×
×
  • Create New...