Begde Posted February 10, 2013 Posted February 10, 2013 Dear all, I'm seeking help in this one also. I'm looking for a routine that will divide an area to selected sub areas and drawing the boundaries of new areas inside the parent area. thanks in advance Quote
Organic Posted February 10, 2013 Posted February 10, 2013 How does it draw the boundary though? It could draw long skinny shapes or intricate twirly shapes or simple rectangles etc... Quote
BIGAL Posted February 11, 2013 Posted February 11, 2013 Post a sketch or dwg your question is to vauge. Quote
Begde Posted February 11, 2013 Author Posted February 11, 2013 Thanks for your interest. I attached a dwg file to what I am thinking of. I just want to get a rectangle inside the area, which represents the sub area. sample.dwg Quote
fixo Posted February 11, 2013 Posted February 11, 2013 Just a quick shot on this way with no error checking (defun C:A2S(/ ang1 ang2 len osm p1 p2 p3 p4 wid) (command "_undo" "_be") (setq osm (getvar "osmode")) (setvar "cmdecho" 0) (if (and (setq p1 (getpoint "\nLower Left corner point: ")) (setq p3 (getpoint p1 "\nUpper Right corner point: ")) (setq p2 (getpoint p3 "\nLower Right corner point: "))) (progn (setq ang1 (angle p2 p1) len (distance p1 p2)) (setq p2 (polar p2 ang1 (/ len 2))) (setq p4 (polar p3 ang1 len)) (setq ang2 (angle p1 p4) wid (distance p1 p4)) (setq p3 (polar p2 ang2 wid)) (command "_pline" "_non" p1 "_non"p2 "_non"p3 "_non"p4 "_CL") (command "_copy" (entlast) "" "_non"p1 "_non"p2) ) ) (setvar "osmode" osm) (command "_undo" "_e") (princ) ) 1 Quote
Begde Posted February 11, 2013 Author Posted February 11, 2013 Thank you fixo for your kind quick reply it is great but can i decide how many splits i can get instead of two! Quote
fixo Posted February 11, 2013 Posted February 11, 2013 Well, try this one instead (defun C:A2S(/ ang1 ang2 len osm p1 p2 p3 p4 wid);;OK (setq *num* 2) (command "_undo" "_be") (setq osm (getvar "osmode")) (setvar "cmdecho" 0) (if (and (setq p1 (getpoint "\nLower Left corner point: ")) (setq p3 (getpoint p1 "\nUpper Right corner point: ")) (setq p2 (getpoint p3 "\nLower Right corner point: ")) (setq num (cond ((getint (strcat"\nSpecify number of subareas (Hit to accept) <"(itoa *num*)">: "))) (num))) ) (progn (setq *num* num) (setq ang1 (angle p1 p2) ang2 (angle p2 p3) len (distance p1 p2) wid (distance p2 p3) ) (setq p2 (polar p1 ang1 (/ len num))) ;;number of divisions were added (setq p4 (polar p1 ang2 wid)) (setq p3 (polar p2 ang2 wid)) (command "_pline" "_non" p1 "_non"p2 "_non"p3 "_non"p4 "_CL") (repeat (- num 1)(command "_copy" (entlast) "" "_non" p1 "_non" p2) (setq p1 p2 p2 (polar p1 ang1 (/ len num)))) ) ) (setvar "osmode" osm) (command "._undo" "_e") (princ) ) 1 Quote
Begde Posted February 12, 2013 Author Posted February 12, 2013 Thank you for your great effort. Quote
trilok2047 Posted June 27, 2013 Posted June 27, 2013 It takes only three points.. can u modify to take it any no. of points we like????? Quote
danielk Posted July 27, 2015 Posted July 27, 2015 Dear all,I'm seeking help in this one also. I'm looking for a routine that will divide an area to selected sub areas and drawing the boundaries of new areas inside the parent area. thanks in advance Probably this Quote
DELLA MAGGIORA YANN Posted March 27 Posted March 27 On 2/11/2013 at 5:11 PM, fixo said: Juste un coup rapide sur cette façon sans vérification d’erreur (defun C:A2S(/ ang1 ang2 len osm p1 p2 p3 p4 wid) (command "_undo" "_be") (setq osm (getvar "osmode")) (setvar "cmdecho" 0) (if (and (setq p1 (getpoint "\nLower Left corner point: ")) (setq p3 (getpoint p1 "\nUpper Right corner point: ")) (setq p2 (getpoint p3 "\nLower Right corner point: "))) (progn (setq ang1 (angle p2 p1) len (distance p1 p2)) (setq p2 (polar p2 ang1 (/ len 2))) (setq p4 (polar p3 ang1 len)) (setq ang2 (angle p1 p4) wid (distance p1 p4)) (setq p3 (polar p2 ang2 wid)) (command "_pline" "_non" p1 "_non"p2 "_non"p3 "_non"p4 "_CL") (command "_copy" (entlast) "" "_non"p1 "_non"p2) ) ) (setvar "osmode" osm) (command "_undo" "_e") (princ) ) VERRY GOOD THANKS Quote
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.