Jump to content

Leaderboard

Popular Content

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

  1. I always like to give the user a way to exit without forcing an error with Esc, e.g.: (while (and (setq x (getreal "\nSpecify a number between 0 and 1: ")) (not (<= 0.0 x 1.0)) ) (princ "\nNumber must be between 0 and 1.") ) (if x ;; do stuff )
    1 point
  2. Here's another... Not tested as it's typed away from CAD. (while (null (< 0.0 (setq rScale (getreal "\nSpecify value: ")) 1.0)) (princ "\nValue is not between 0 and 1") )
    1 point
  3. You could use my custom XLine program from here.
    1 point
  4. Try this: (defun c:s2o (/ a b c d el m s) ;; RJP » 2020-04-29 ;; Could give bad results for multiple vertices that are within the 'search distance' (cond ((and (setq d (getdist "\nPick a distance to search: ")) (setq s (ssget ":L" (list '(0 . "POINT,LWPOLYLINE")))) ) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (if (= "POINT" (cdr (assoc 0 (setq el (entget e))))) (setq a (cons (list (cdr (assoc 10 el)) e) a)) (setq b (cons (vl-remove-if '(lambda (x) (/= 10 (car x))) el) b)) ) ) (if (setq b (mapcar 'cdr (apply 'append b))) (foreach p a (setq c (mapcar '+ (car p) '(0 0))) (cond ((setq m (vl-some '(lambda (x) (if (equal c x d) x)) b)) (setq b (vl-remove m b)) (entmod (append (entget (cadr p)) (list (cons 10 (append m (list (last (car p)))))))) ) ) ) ) ) ) (princ) )
    1 point
×
×
  • Create New...