lizp Posted May 21, 2009 Author Share Posted May 21, 2009 OK, I think I got it -- one has to painstakingly carefully make the ends of the neighboring lines that are not touching overlap and then use the JOIN tool. Busy work and now that I'm spoiled by the AutoLisp code, seems cumbersome. Just kiddin'. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 21, 2009 Share Posted May 21, 2009 OK, I think I got it -- one has to painstakingly carefully make the ends of the neighboring lines that are not touching overlap and then use the JOIN tool. Busy work and now that I'm spoiled by the AutoLisp code, seems cumbersome. Just kiddin'. It may be cumbersome, but tbh, a polyline would have been a better option from the start - you have many more options and much more versatility with it. Quote Link to comment Share on other sites More sharing options...
lizp Posted May 21, 2009 Author Share Posted May 21, 2009 That seems to be the case, indeed. Unfortunately, I can't get to connect all the segments. Some are connecting all right. However, when I try to connect others a message appears reading: 'Line, open polyline, arc, elliptical arc, or open spline expected. Select a supported object:'. How does one turn that thing into a supported object? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 21, 2009 Share Posted May 21, 2009 That seems to be the case, indeed. Unfortunately, I can't get to connect all the segments. Some are connecting all right. However, when I try to connect others a message appears reading: 'Line, open polyline, arc, elliptical arc, or open spline expected. Select a supported object:'. How does one turn that thing into a supported object? If you post what you have, I could see what is happening and where you are having trouble Quote Link to comment Share on other sites More sharing options...
lizp Posted May 21, 2009 Author Share Posted May 21, 2009 Here it is (see attached). I was able to connect many (probably ten) of the segments but now these are giving me the message I mentioned. segmented_track_CONVERTED_almost_2004.dxf Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 21, 2009 Share Posted May 21, 2009 Ok, here it is as a complete curve - just took a bit of messing with - some ends weren't tied up etc. segmented_track_CONVERTED_almost_2004.dwg Quote Link to comment Share on other sites More sharing options...
lizp Posted May 21, 2009 Author Share Posted May 21, 2009 Thanks. How could you do that? I made sure that the ends are connected but the type of some of the curves was something different from lines or polylines, although one couldn't tel just bu clicking on the curve. How did you convert these weird segments into proper polyline curves. I tried PEDIT over and over again but it didn't do any good. Now it looks great, though. Thanks again. Hope this would solve the problem with the Blue curve. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 21, 2009 Share Posted May 21, 2009 Thanks. How could you do that? I made sure that the ends are connected but the type of some of the curves was something different from lines or polylines, although one couldn't tel just bu clicking on the curve. How did you convert these weird segments into proper polyline curves. I tried PEDIT over and over again but it didn't do any good. Now it looks great, though. Thanks again. Hope this would solve the problem with the Blue curve. This should solve the problem by using a continuous curve - (but remember this for next time... :wink: ). As for the conversion, there were still some ends that needed tidying up - I also performed "OVERKILL" (express tools) to clear up any duplicates, and some of the smaller polylines I had to trace for some reason - I am not sure why these would not join, perhaps overlapping vertices or something deeper, but all is fine now Lee Quote Link to comment Share on other sites More sharing options...
lizp Posted May 22, 2009 Author Share Posted May 22, 2009 Thanks again, Lee. That OVERKILL thing works really great. I tried it just to see what that is, checked all there is to be checked and everything started to work fine, it seems. Now, how would you recommend to do the deformation of the track? One handle at a time seems not to yield a smooth curve, let alone it's tedious. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 22, 2009 Share Posted May 22, 2009 Just had another thought - what if you model it as a spline, then convert it to an LWPOLYLINE before running the LISP? I wrote an old Spline->Polyline convertor a while back, give it a shot [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:sp2pl [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] segs doc spc ss sglen i pt ptlst nPoly[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] segs [b][color=#009900]100[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-Acad-Object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]zerop[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-activespace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-mspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=Blue]:vlax-true[/color][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-paperspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#ff00ff]"SPLINE"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-remove-if[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]listp[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] ss[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] sglen [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getDistatParam[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getEndParam[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getDistatParam[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getStartParam[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] segs[b][color=RED])[/color][/b] i [b][color=#009900]-1[/color][/b] ptlst [b][color=BLUE]nil[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getPointatDist[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]*[/color][/b] sglen [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]>=[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]distance[/color][/b] pt [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getEndPoint[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b] sglen[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ptlst [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] pt ptlst[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ptlst [b][color=RED]([/color][/b][b][color=BLUE]apply[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]append[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]trans[/color][/b] x [b][color=#009900]0[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] ptlst[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] nPoly [b][color=RED]([/color][/b][b][color=BLUE]vla-addLightweightPolyline[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]vlax-make-variant[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray-fill[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-make-safearray[/color][/b] [color=Blue][b]vlax-vbDouble[/b][/color] [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]1-[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]length[/color][/b] ptLst[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] ptlst[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-put-layer[/color][/b] nPoly [b][color=RED]([/color][/b][b][color=BLUE]vla-get-layer[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-put-linetype[/color][/b] nPoly [b][color=RED]([/color][/b][b][color=BLUE]vla-get-linetype[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-put-linetypescale[/color][/b] nPoly [b][color=RED]([/color][/b][b][color=BLUE]vla-get-linetypescale[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-put-color[/color][/b] nPoly [b][color=RED]([/color][/b][b][color=BLUE]vla-get-color[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-delete[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> No Splines Selected <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] Quote Link to comment Share on other sites More sharing options...
lizp Posted May 22, 2009 Author Share Posted May 22, 2009 This is a great routine. Unfortunately, the problem with reversing the Cyan vectors pops up again here. As before, the Green are good but the Cyan reverse sign. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 22, 2009 Share Posted May 22, 2009 This is a great routine. Unfortunately, the problem with reversing the Cyan vectors pops up again here. As before, the Green are good but the Cyan reverse sign. Haha - vicious circle this is... 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.