samifox Posted June 23, 2013 Share Posted June 23, 2013 Hi i found a way to isolate them, that is by distance and angle. im tring to find the columns in the stracture based on thier vertices relative location. this code scan polylines's vertices and find their square pairs (please see the attached image to get what i mean) this function get a vertex, a list of candidates, and the upper threshold of the condition. it ask the user to selects all polylines, than it extract their vertices and append them to one long list. than the vertex compared with the element # of the list for not being the same, and for the distance between them not more than d. only one can be pair of the vertex. than a new list is contracted with a single pair and returned to the caller (defun C:findPair (/ pl pts sspl tpts i ptlist) (if (setq sspl (ssget '((0 . "LWPOLYLINE")))) (progn (setq i 0) (while (< i (sslength sspl)) (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (e) (= (Car e) 10)) (entget (ssname sspl i)) ) ) ) (setq i (1+ i)) (setq tpts (cons pts tpts)) ) ) ) (setq tpts (apply 'append tpts)) (setq ln (findPairs (nth 0 tpts) tpts 58)) ;;; (command "LINE" (nth 0 ln) (nth 1 ln) ) ) (defun findPairs(fxp lst d / i p tot col ) (setq i 0) (while (< i (length lst)) (setq col (vl-remove-if-not '(lambda (e) (and (not (equal fxp e)) (> d (distance (fxp e)))))lst)) (setq i (1+ i)) (setq tot (cons col tot)) ) tot ) its tell this : ; error: bad function: (488.547 225.746) (and any idea why i cant follow brackpoint after lambda?) Thanks Shay Quote Link to comment Share on other sites More sharing options...
BlackBox Posted June 23, 2013 Share Posted June 23, 2013 Why didn't you just add this to your other thread, instead of creating a duplicate? Quote Link to comment Share on other sites More sharing options...
samifox Posted June 23, 2013 Author Share Posted June 23, 2013 i create another thread to help categorize it, meaning if someone will look for this information the title is more relevant to his search keywords Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.