Hải_Duy Posted November 13, 2023 Posted November 13, 2023 Because we want the boundary line to be a close polyline, we must convert the elipse and spline into a polyline. One problem I have is that when converting, the more points the weight is, the less points the accuracy is not high. Please suggest me a simple algorithm so that the connecting segments are minimal new block.dwg Quote
mhupp Posted November 13, 2023 Posted November 13, 2023 Maybe run overkill ? Quote : OVERKILL 0 duplicate(s) deleted 4055 overlapping entities or segment(s) deleted still not enough you are going to have to redraw the radius. that is where most of the points are. Quote
Hải_Duy Posted November 13, 2023 Author Posted November 13, 2023 @mhupp Sorry, can you take a look at this drawing again? abc.dwg Quote
Steven P Posted November 13, 2023 Posted November 13, 2023 pedit? then select the spline, though this converts the arcs to short lines of the length you specify. You can choose a short length and then http://www.theswamp.org/index.php?topic=19865.msg244892#msg244892 might do it, , I guess 'A' which is the last offering on that page. Will reduce straight edges in the polyline to a single vertex but the curves will still be short line segments Wish I hadn't seen this because I think there it is possible to make a much better LISP to include arcs instead of straight lines in resulting polyline Quote
BIGAL Posted November 13, 2023 Posted November 13, 2023 Did the shape come from a manufacturer that way as a dwg ? Its almost done that way to make it harder to edit. Almost want to trace over with straights and then fillet joining 2 straights. How many shapes involved ? Quote
exceed Posted November 14, 2023 Posted November 14, 2023 (edited) (defun c:spl2pl ( / ss i ent ss3 ss2 obj cpcount j ) (princ "\n Select spline to convert to pline : ") (setq ss (ssget '((0 . "SPLINE")))) (setq i 0) (setq ss3 (ssadd)) (repeat (sslength ss) (setq ent (ssname ss i)) (command "_explode" ent "") (setq ss2 (ssget "_P")) (setq j 0) (repeat (sslength ss2) (setq ent2 (ssname ss2 j)) (setq obj (vlax-ename->vla-object ent2)) (setq cpcount (vlax-get-property obj 'Numberofcontrolpoints)) (command "_SPLINEDIT" ent2 "_P" cpcount "") (ssadd (entlast) ss3) (setq j (+ j 1)) ) (setq i (+ i 1)) ) (if (> (sslength ss3) 1) (progn (command "_pedit" "_M" ss3 "" "J" "0" "") ) (progn (command "_pedit" ss3 "") ) ) (princ) ) 1. Roughly, i think this is not you want 2. use wmf zoom > object wmfout wmfin explode it you get 2dpolyline automatically, > scale it and convert 3. save as drawing or wblock spline to oldest .dxf version as you can, ex) R12 and then reopen it. it changed to 3dpolyline explode it and then mpedit join them all Edited November 14, 2023 by exceed 3 Quote
Hải_Duy Posted November 14, 2023 Author Posted November 14, 2023 @BIGALExactly, the supplier gave me the dwg and I want to connect it into a polyline with a minimum number of connection points. Quote
Hải_Duy Posted November 14, 2023 Author Posted November 14, 2023 @exceed This is exactly the code I needed, thank you very much bro 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.