I have imported a dwg file from Sketchup, the problem is Arc, Circle and Curved lines are Segmented, I would like to convert it to non-segmented drawing so it is easy for me to put radius and snap to the right vertices. I found the right LSP for the circle but not for the arc and ellipse, when I tried it on the arc it will create a circle.
Is there a way to convert this?? Thanks.
@Anonymous wrote:
.... Arc, Circle and Curved lines are Segmented, I would like to convert it to non-segmented drawing .... I found the right LSP for the circle but not for the arc and ellipse....
That's one of mine. Here's a modification for the Arc variety [untested]:
(defun C:PS2A (/ ss n pl pars); = Polyline{s} of Segments {to} Arc{s}
(prompt "\nTo draw true Arcs over mult-segment Polylines approximating arcs,")
(setq ss (ssget "_:L" '((0 . "*POLYLINE"))))
(repeat (setq n (sslength ss))
(setq
pl (ssname ss (setq n (1- n)))
pars (vlax-curve-getEndParam pl); number of PARameterS
); setq
(command "_.arc"
"_none" (vlax-curve-getStartPoint pl)
"_none" (vlax-curve-getPointAtParam pl (/ pars 2))
"_none" (vlax-curve-getEndPoint pl)
); command
(entdel pl); remove original [optional]
); repeat
); defun
You would need to select the ones that are Arc-like. As with the Circle variety, it will draw an Arc between the start, somewhere in the middle, and the end, of any selected Polyline(s) of any shape. [The circle one likewise, which you have already discovered.] Something could be made that could determine arc-likeness, and do it to only those that qualify, but that would be quite a bit more complex.
For the Ellipse, what range of possibilities are there? I can imagine a way to do it if they're always and only half-Ellipses between ends of the same axis, as in your image. If not, I'm having a hard time picturing how a routine would be able to figure out the axis endpoints, which it will need to draw a true Ellipse.
Thank you so much it works in a segmented arc and big help, but I don't think it will work on an ellipse, I'm a fan and user of your lisp. and it makes my work easier.
Can't find what you're looking for? Ask the community or share your knowledge.