wal_dab Posted July 31, 2016 Share Posted July 31, 2016 HI How to connect lines and poly-lines at center of circle, please find attached picture. many thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 1, 2016 Share Posted August 1, 2016 Try the following: ([color=BLUE]defun[/color] c:cc ( [color=BLUE]/[/color] cn1 cn2 en1 en2 ent gr1 gr2 rd1 rd2 ) ([color=BLUE]while[/color] ([color=BLUE]progn[/color] ([color=BLUE]setvar[/color] 'errno 0) ([color=BLUE]setq[/color] ent ([color=BLUE]car[/color] ([color=BLUE]entsel[/color] [color=MAROON]"\nSelect circle: "[/color]))) ([color=BLUE]cond[/color] ( ([color=BLUE]=[/color] 7 ([color=BLUE]getvar[/color] 'errno)) ([color=BLUE]princ[/color] [color=MAROON]"\nMissed, try again."[/color]) ) ( ([color=BLUE]null[/color] ent) [color=BLUE]nil[/color]) ( ([color=BLUE]/=[/color] [color=MAROON]"CIRCLE"[/color] ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 0 ([color=BLUE]setq[/color] en1 ([color=BLUE]entget[/color] ent))))) ([color=BLUE]princ[/color] [color=MAROON]"\nSelected object is not a circle."[/color]) ) ( ([color=BLUE]setq[/color] cn1 ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 10 en1)) rd1 ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 40 en1)) ) ([color=BLUE]while[/color] ([color=BLUE]progn[/color] ([color=BLUE]setq[/color] gr1 ([color=BLUE]grread[/color] [color=BLUE]t[/color] 13 2) gr2 ([color=BLUE]cadr[/color] gr1) gr1 ([color=BLUE]car[/color] gr1) ) ([color=BLUE]cond[/color] ( ([color=BLUE]=[/color] 5 gr1) ([color=BLUE]redraw[/color]) ([color=BLUE]grdraw[/color] ([color=BLUE]polar[/color] cn1 ([color=BLUE]angle[/color] cn1 gr2) rd1) gr2 1 1) [color=BLUE]t[/color] ) ( ([color=BLUE]=[/color] 3 gr1) ([color=BLUE]cond[/color] ( ([color=BLUE]not[/color] ([color=BLUE]setq[/color] ent ([color=BLUE]car[/color] ([color=BLUE]nentselp[/color] gr2)))) ([color=BLUE]princ[/color] [color=MAROON]"\nMissed, try again."[/color]) ) ( ([color=BLUE]/=[/color] [color=MAROON]"CIRCLE"[/color] ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 0 ([color=BLUE]setq[/color] en2 ([color=BLUE]entget[/color] ent))))) ([color=BLUE]princ[/color] [color=MAROON]"\nSelected object is not a circle."[/color]) ) ( ([color=BLUE]setq[/color] cn2 ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 10 en2)) rd2 ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 40 en2)) ) ([color=BLUE]entmakex[/color] ([color=BLUE]list[/color] '(0 . [color=MAROON]"LINE"[/color]) ([color=BLUE]cons[/color] 10 ([color=BLUE]polar[/color] cn1 ([color=BLUE]angle[/color] cn1 cn2) rd1)) ([color=BLUE]cons[/color] 11 ([color=BLUE]polar[/color] cn2 ([color=BLUE]angle[/color] cn2 cn1) rd2)) ) ) ([color=BLUE]redraw[/color]) ([color=BLUE]setq[/color] cn1 cn2 rd1 rd2) ) ) ) ) ) ) ) ) ) ) ([color=BLUE]redraw[/color]) ([color=BLUE]princ[/color]) ) Quote Link to comment Share on other sites More sharing options...
jscgvnc Posted August 2, 2016 Share Posted August 2, 2016 Lee, This is awesome. Thank you. Could it be modified to connect from the center of a circle to the center of a line, or segment of a line? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 2, 2016 Share Posted August 2, 2016 This is awesome. Thank you. You're welcome! Could it be modified to connect from the center of a circle to the center of a line, or segment of a line? What you do mean by connecting to a 'segment of a line'? - Could you post an image? Quote Link to comment Share on other sites More sharing options...
jscgvnc Posted August 3, 2016 Share Posted August 3, 2016 Lee, I meant the center of a segment of a polyline. Say if you had a polyline with three line, connecting to the center of one of the segments. I'm not sure if that's the official naming convention. Sorry for the confusion. Quote Link to comment Share on other sites More sharing options...
wal_dab Posted August 23, 2016 Author Share Posted August 23, 2016 many thanks Lee Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 23, 2016 Share Posted August 23, 2016 Instead of breaking all those lines at the circle (lines no longer match displayed length), just use a block with a wipeout to cover the intersecting lines. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 24, 2016 Share Posted August 24, 2016 AlanJt nice idea much better as lines are still true length. Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 24, 2016 Share Posted August 24, 2016 AlanJt nice idea much better as lines are still true length. Thank you. I'm just not a fan of altering data for the sake of presentation. I'd rather come up with an alternate solution. 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.