Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello
Our customer send us drawing with ellipse segments into.
With Autocad 2008 I bought a plug-in call SplineConvert that did the job perfectly but not compatible with 2013.
Is there any plugin that could replace that tool ?
Is there any standard ACAD command that could easily do this Job ?
I need a way to make 2 or 3 times per week this converting on all ellipses of large and detail 2D drawings so no time to offset in and out all those .
I try also DXFOUT in R12 but all the spline are being converted into 3d polyline making a huge files that froze my PC.
I also try FLATTEN but did not see how it work , the ellipse stay an ellipse.
Is there anyone with a link or a method to solve this problem ?
Thank in advance !!!
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
plap1 wrote:....
Is there any standard ACAD command that could easily do this Job ?
I need a way to make 2 or 3 times per week this converting on all ellipses of large and detail 2D drawings so no time to offset in and out all those .
....
Try this [minimally tested]:
(vl-load-com); if needed
(foreach
x
(mapcar 'cadr (ssnamex (ssget "X" '((0 . "ELLIPSE"))))); all Ellipse objects in list
(vla-offset (vlax-ename->vla-object x) 1); offset outward
(entdel x); get rid of original Ellipse
(setq x (entlast))
(vla-offset (vlax-ename->vla-object x) -1); offset inward
(entdel x); get rid of intermediate Spline
)
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
First of all I have to say Kent that I really like your mapcar fuction. I wouldn't have thought of using ssnamex to create a list of enames. Very cool.
If you don't mind I would like to use that line here. If the OP (or any one else) has Express Tools loaded. Give this a try. I have tried using the follow code in AutoCAD 2013 and it worked for me. Hope that helps.
(foreach x (mapcar 'cadr (ssnamex (ssget "X" '((0 . "ELLIPSE"))))) (ACET-GEOM-ELLIPSE-TO-PLINE x) (entdel x) )
Jim
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
jsowinski wrote:First of all I have to say Kent that I really like your mapcar fuction. I wouldn't have thought of using ssnamex to create a list of enames. Very cool.
....
I can't take credit for thinking up that (mapcar)-with-(ssnamex) thing -- it was a trick that a user with the handle Some Buddy used, a couple/few years back. I think their version was somewhat more complicated, because it was for a selection set that included user-picked objects, for which (ssnamex) returns a different assortment of information depending on how each thing got into the set. So at first I didn't catch on to what it could do. But when you're using (ssget "X"), the entity name is always the second element in each entry in the list (ssnamex) returns, so you can just apply (cadr) to everything and get a straightforward list of entity names. When applicable, doing that and running a (foreach) function on the resulting list can be simpler than stepping through a selection set.
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Mr Cooper
I have well receive your last message with namex instruction in but I don't know how do i uste it ?
Is it a lisp instruction or a command I have to put at the command line or another way of giving instruction to ACAD.
Also I joined a lisp routine that is near to perfect execpt that it don't keep original layer after transform. Could you take a look .
Thank you for your help again .
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
plap1 wrote:....
I have well receive your last message with namex instruction in but I don't know how do i uste it ?
....
Also I joined a lisp routine that is near to perfect execpt that it don't keep original layer after transform. ....
You use it as in my first post on this thread, where
(mapcar 'cadr (ssnamex (ssget "X" '((0 . "ELLIPSE"))))); all Ellipse objects in list
makes a list of all Ellipses. You can do anything you want with that list -- it's just a list of entity names.
If I understand your routine correctly [I learned only a little bit of French, and a long time ago], it is drawing an all-line-segments Polyline over the selected object(s). It doesn't do anything at all about the Layer, so it is simply drawing the Polyline on the current Layer, whatever that is. Something would need to be added to either set the current Layer to that of the selected object before drawing the Polyline [and presumably set it back later], or change the new Polyline to that Layer after it's drawn [which avoids the need to change or reset the current Layer].
Here's one way to do the latter. After the Polyline is drawn by the (command "_.pline".... line of code, do this:
(vla-put-Layer (vlax-ename->vla-object (entlast)) (vla-get-Layer obj_vlax))
Re: Convert Ellipse segment into spline or polyline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
