marko_ribar Posted November 8, 2013 Share Posted November 8, 2013 Attached lisp file replaced due to the lack of (command) function vs (entmake) function... Now posted lisp should correctly work and on versions Also, no matter that it's called snakefill-2linesboundaries-arc, it can be applied and on 2 curve boundaries as long as reference arc (half circle) would make intersections while copy-moving along horizontal/vertical curve boundaries... Regards, M.R. Quote Link to comment Share on other sites More sharing options...
CafeJr Posted November 8, 2013 Author Share Posted November 8, 2013 Attached lisp file replaced due to the lack of (command) function vs (entmake) function... Now posted lisp should correctly work and on versions Also, no matter that it's called snakefill-2linesboundaries-arc, it can be applied and on 2 curve boundaries as long as reference arc (half circle) would make intersections while copy-moving along horizontal/vertical curve boundaries... Regards, M.R. Marko_ribar It's working!... I did some tests and I'm showing to you the result on the picture... I don't know, but, because the arc is so big to try to follow the boundary line, it could cause the situation 1. Also, following a arc as a reference line I miss a little distance of boundary line the situation 2... The boundary lines aren't a perfect lines as a arc, because it, I asked if it's possible to choose a pline to follow instead of a arc... Grateful... Quote Link to comment Share on other sites More sharing options...
CafeJr Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) Marko_ribar, As I told you, I'm trying to do it in the worst way!... But, is a good beginning to someone that is newbie in this kind of code!... I guess!... Thanks again... (defun C:RS3 (/ l1 l2 l3 p1 p2 p3 p4 pa c1 c2 r ptd1 ptd2 ss) (prompt "\nSelect reference line:") (setq l1 (ssget) p1 (getpoint "\nEnter with center 1:") p2 (getpoint "\nEnter with center 2:") p4 (list (+ (car p1) (/ (- (car p2) (car p1)) 2)) 0.0 0.0) r (getreal "\nEnter with radius: ") n (getint "\nEnter with number of lines: ") i 1 c1 (ssadd) l2 (ssname l1 1) l3 (ssname l1 2) l1 (ssname l1 0) ) (while (= nil n) (setq n (getint "\nEnter with number of lines, must be > 0: ")) ) (command "_CIRCLE" p1 r) (ssadd (entlast) c1) (command "_CIRCLE" p2 r) (ssadd (entlast) c1) (while (<= i n) (setq p2 (- (cadr p1) (* r 4 i)) p3 (- (cadr p1) (* r 2 i)) ptd1 (list (car p1) p2 (caddr p1)) ptd2 (list (car p1) p3 (caddr p1)) ) (if (<= i (/ n 2)) (command ".copy" c1 "" p1 ptd1) ) ; Drawing circles (command ".copy" l1 "" p1 ptd2) ; Drawing lines (setq i (1+ i) ) ) (load "extrim") (etrim l2 p4) (etrim l3 p4) (setq pa (getvar "peditaccept")) (setvar "peditaccept" 1) (setq ss (ssget)) (command "pedit" "m" ss "" "j" "0.01" "") (setvar "peditaccept" pa) ) Edited November 18, 2013 by CafeJr Edit: A little bit better than last one!... Quote Link to comment Share on other sites More sharing options...
CafeJr Posted November 29, 2013 Author Share Posted November 29, 2013 (edited) Another code, a little bit more simple than the latest!... It's necessary select the entity to copy, the begin of the first arc, the opposite side of reference line, fill up the radius of arc and number of lines... Before to execute the code, you need to prepare the filled area, drawing lines 1, 2 and 3. Line 1 is the line to be copied; line 2 and 3 the side limits. Edit: translated to english... (defun C:RS1 (/ l1 l2 l3 p1 p2 p3 p4 p5 pa c1 c2 r ptd1 ptd2 ss os) (prompt "\nSelect the lines reference, as: (1 - Line to be copied; 2 and 3 side limits): " ) (setq l1 (ssget) p1 (getpoint "\nEnter with begin of first arc, point 1:") p2 (getpoint "\nEnter with end of line (opposite side of arc), point 2:") p5 p2 p4 (list (+ (car p1) (/ (- (car p2) (car p1)) 2)) 0.0 0.0) r (getreal "\nEnter with radius: ") n (getint "\nEnter with number of lines: ") i 1 c1 (ssadd) l2 (ssname l1 1) l3 (ssname l1 2) l1 (ssname l1 0) ) (setq os (getvar "osmode")) (setvar "osmode" 0) (while (= nil n) (setq n (getint "\nEnter with number of lines, must be > 0: ")) ) (setq p2 (- (cadr p1) r) p3 (- (cadr p5) (* r 3)) ptd1 (list (car p1) p2 (caddr p1)) ptd2 (list (car p5) p3 (caddr p5)) ) (command "_CIRCLE" ptd1 r) (ssadd (entlast) c1) (command "_CIRCLE" ptd2 r) (ssadd (entlast) c1) (while (<= i n) (setq p2 (- (cadr p1) (* r 4 i)) p3 (- (cadr p1) (* r 2 i)) ptd1 (list (car p1) p2 (caddr p1)) ptd2 (list (car p1) p3 (caddr p1)) ) (if (<= i (/ n 2)) (command ".copy" c1 "" p1 ptd1) ) ; Drawing circles (command ".copy" l1 "" p1 ptd2) ; Drawing lines (setq i (1+ i) ) ) (load "extrim") (etrim l2 p4) (etrim l3 p4) (command "_.erase" l2 "") (command "_.erase" l3 "") (setq pa (getvar "peditaccept")) (setvar "peditaccept" 1) (setq ss (ssget)) (command "pedit" "m" ss "" "j" "0.01" "") (setvar "peditaccept" pa) (setvar "osmode" os) ) Edited November 29, 2013 by CafeJr Quote Link to comment Share on other sites More sharing options...
Perra Posted December 7, 2017 Share Posted December 7, 2017 Hey! Is a new member and saw a Lisp that makes it easier to draw underfloor heating. Do not know, but can you point to a starting point where the heater starts and an end point where the heating pipe will stop? These two tubes are almost always short-lived each other. Thus the optimum would be a starting point an end point and then you draw with the mouse what surface you want under floor heating. As I said, I am a beginner. Thanks in advance. Per-Anders 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.