Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a lisp example that work pretty good , this lisp draw between blocks base point, but need add limits as promtp options, first-limit should ignore all blocks under a certain distance and second-limit should of ignore all block over a certain diatance. Leave promtp in blank should be understood like "no limits" for both options. Such "certain distance worth" should be inserted by keyboard or click between 2 points in drawing.
Here is the lisp base:
(defun c:connect (/ end fuzz pt ron ss sset) (if (and (setq ss (ssget '((0 . "line")))) (setq fuzz 0.20) ) (foreach x (setq sset (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (foreach p (list (vlax-curve-getstartpoint x) (vlax-curve-getendpoint x) ) (foreach y sset (if (and (not (equal (vlax-curve-getclosestpointto y p) p 1e-11 ) ) (or (<= (distance (setq pt (vlax-curve-getstartpoint y)) p) fuzz ) (<= (distance (setq pt (vlax-curve-getendpoint y)) p) fuzz ) ) (not (equal x y)) (> (cadr p) (cadr pt)) ) (entmod (subst (cons (setq end (if (equal p (vlax-curve-getstartpoint x)) 10 11 ) ) pt ) (assoc end (setq ron (entget x))) ron ) ) ) ) ) ) ) (princ) )
Enjoy
Solved! Go to Solution.