CafeJr Posted October 18, 2013 Share Posted October 18, 2013 Hello guys, I again, needing a help... Some one knows how do a link with lines as the picture bellow? I have on a drawing lines that need to be closed to make one area, but, to do it it's necessary to get some lines and do a contour line, linking the points... Thanks... Quote Link to comment Share on other sites More sharing options...
troggarf Posted October 18, 2013 Share Posted October 18, 2013 Check this thread. http://www.cadtutor.net/forum/showthread.php?48022-spline-lisp ~Greg Quote Link to comment Share on other sites More sharing options...
pBe Posted October 18, 2013 Share Posted October 18, 2013 Hello guys, I again, needing a help... Some one knows how do a link with lines as the picture bellow? I have on a drawing lines that need to be closed to make one area, but, to do it it's necessary to get some lines and do a contour line, linking the points... Thanks... What are those circles? are they part of the "drawing lines" or just a guide to link the contours? as always you need to provide a drawing sample. The link troggarf posted looks promising. Quote Link to comment Share on other sites More sharing options...
CafeJr Posted October 18, 2013 Author Share Posted October 18, 2013 What are those circles? are they part of the "drawing lines" or just a guide to link the contours? as always you need to provide a drawing sample. The link troggarf posted looks promising. The circles are only to show what points I need to link!... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 18, 2013 Share Posted October 18, 2013 My version (defun c:Test (/ ss in en st nd up dn u d) ;; Tharwat 18.Oct.2013 ;; (if (setq ss (ssget '((0 . "LINE")))) (progn (repeat (setq in (sslength ss)) (setq en (entget (ssname ss (setq in (1- in)))) st (cdr (assoc 10 en)) nd (cdr (assoc 11 en)) ) (if (> (cadr st) (cadr nd)) (setq up (cons st up) dn (cons nd dn) ) (setq dn (cons st dn) up (cons nd up) ) ) ) (setq u (vl-sort up '(lambda (a b) (< (car a) (car b)))) d (vl-sort dn '(lambda (j k) (< (car j) (car k)))) ) (while (> (length u) 1) (entmakex (list '(0 . "LINE") (cons 10 (car u)) (cons 11 (cadr u))) ) (setq u (cdr u)) ) (while (> (length d) 1) (entmakex (list '(0 . "LINE") (cons 10 (car d)) (cons 11 (cadr d))) ) (setq d (cdr d)) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
CafeJr Posted October 18, 2013 Author Share Posted October 18, 2013 Check this thread. http://www.cadtutor.net/forum/showthread.php?48022-spline-lisp ~Greg Thank you "troggarf"... I'm studying the code... probably it's it!... (but using pline, no spline on code!...) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 18, 2013 Share Posted October 18, 2013 And this one draw LWpolylines . (defun c:Test (/ _LW ss in en st nd up dn u d) ;; Tharwat 18.Oct.2013 ;; (defun _LW (lst) (entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length lst)) '(70 . 0) ) (mapcar (function (lambda (p) (cons 10 p))) lst) ) ) ) (if (setq ss (ssget '((0 . "LINE")))) (progn (repeat (setq in (sslength ss)) (setq en (entget (ssname ss (setq in (1- in)))) st (cdr (assoc 10 en)) nd (cdr (assoc 11 en)) ) (if (> (cadr st) (cadr nd)) (setq up (cons st up) dn (cons nd dn) ) (setq dn (cons st dn) up (cons nd up) ) ) ) (setq u (vl-sort up '(lambda (a b) (< (car a) (car b)))) d (vl-sort dn '(lambda (j k) (< (car j) (car k)))) ) (if (> (length u) 1) (_LW u) ) (if (> (length d) 1) (_LW d) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
CafeJr Posted October 18, 2013 Author Share Posted October 18, 2013 Tharwat, This code LWpline is that I need!... Thank you a lot!!!... And this one draw LWpolylines . Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 18, 2013 Share Posted October 18, 2013 Tharwat, This code LWpline is that I need!... Thank you a lot!!!... You're welcome anytime . Quote Link to comment Share on other sites More sharing options...
pBe Posted October 20, 2013 Share Posted October 20, 2013 The circles are only to show what points I need to link!... Arent there two sets of lines to select , the white lines on top and the red lines at the bottom? Quote Link to comment Share on other sites More sharing options...
CafeJr Posted October 20, 2013 Author Share Posted October 20, 2013 Yes pBe, there are two lines blue and red, I need to execute the code twice, but it's working as good as I need!... Quote Link to comment Share on other sites More sharing options...
pBe Posted October 21, 2013 Share Posted October 21, 2013 Yes pBe, there are two lines blue and red, I need to execute the code twice, but it's working as good as I need!... Ok then, save us time to write a code for that condition Cheers CafeJr. Quote Link to comment Share on other sites More sharing options...
CafeJr Posted October 21, 2013 Author Share Posted October 21, 2013 Ok then, save us time to write a code for that condition Cheers CafeJr. I'm grateful, about your help!!!... 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.