Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/31/2018 in all areas

  1. Think David has put in many many hours. Respect!
    1 point
  2. For your information, this doesn't create what you think it does. ("layer" . (command "-layer" "make" "BLOCK1_LAYER" "color" "1" "" "lw" "0.5" "" "lt" "continuous" "")) If you cut and paste the following into the command line then press return, it will create the layer and set it as current (note that there is an extra return ("") added at the end to close the command). (command "-layer" "make" "BLOCK1_LAYER" "color" "1" "" "lw" "0.5" "" "lt" "continuous" "" "") The next line will read "command: nil" It does not return the name of the layer created so what you have in fact created is ("layer" . nil) This is true of almost all (command ....) calls in lisp. It is far better to pass in the layer name, extract it then test if it exists, and if not create it. (setq mylayer (cdr (assoc "layer" mylist))) (if (not (tblsearch "layer" mylayer));if it doesn't exist (command "_-layer" "_M" mylayer "_C" "1" "_LT" "continous" .....);make it and set current (setvar "clayer" mylayer);does exist, make it current );end_if
    1 point
  3. Yes, the parallel Osnap is a tricky one to master!
    1 point
  4. I'm not entirely sure this is correct, but try changing dist (+ dist (cdr (assoc bname paramlst))) to dist (+ start dist)
    1 point
  5. only applicable for your list structure - without recursive (apply 'append (mapcar ''((x)(mapcar 'cadr (cdr x))) lst ))
    1 point
  6. Another (defun coords (lst) (apply 'append (mapcar '(lambda (x) (cond ((atom x) nil) ((vl-every 'numberp x) (list x)) ((coords x)) ) ) lst ) ) )
    1 point
  7. (defun foo ( L / pointp r) (defun pointp ( p ) (and (vl-consp p) (= 3 (length p)) (apply 'vl-every (cons 'numberp (list p))))) (while L (setq r (append (vl-remove-if-not 'pointp L) r)) (setq L (apply 'append (vl-remove-if-not 'vl-consp L))) ); while r ); defun foo _$ (equal (coords lst) (foo lst) 1e-2) T The above check equals to (vl-consp lst) (defun f ( L ) (cond ( (atom L) nil) ( (append (f (car L)) (f (cdr L))) ) ( (and (= 3 (length L)) (vl-every 'numberp L)) (list L) ) ) )
    1 point
×
×
  • Create New...