Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Arcview line segments back to Autocad arc

5 REPLIES 5
Reply
Message 1 of 6
MetroVancouverDrafting
1041 Views, 5 Replies

Arcview line segments back to Autocad arc

When importing Shape files from Arcview/ArMap to Autocad you will find that all yor arcs were converted to the series of lines.

Now the question is how to convert them back to the true arc.

 

I wrote some lisp to address it, but you have to do a lot af manual work before use it and it is sooooow

The lisp is inside of the cad file, just copy/paste to command line.

I will stuck after about 5 min, just kill it Ctrl+Breack or Esc.

 

is anybody has a better solution, cause mine is not solution at all. If I'll start to improve it and analyse dipper it'll get even slower.

Tags (1)
5 REPLIES 5
Message 2 of 6


@Caddhelp wrote:

When importing Shape files from Arcview/ArMap to Autocad you will find that all yor arcs were converted to the series of lines.

Now the question is how to convert them back to the true arc.

....


Maybe you can use elements of PolygonToCircle.lsp attached to message 20 [if you have them chronologically] here:

 

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Circle-to-Polyline-circular-Polyline-...

 

It's built to convert regular Polygons to Circles, so it contains some things that you won't want [it works only with closed Polylines, and checks that all segments are the same length, which your little Lines are not quite].

 

But here's what you probably can use:  it calculates the center of the Circle, using qualities of two Polyline segments that shouldn't be hard to convert to qualities of two Lines.  I think you would need to select two lines on the same arc path that you want.  Then something could be made to go through a selection set of all Lines, keep only those Lines with both endpoints the same distance from that calculated center [that part is in there, but using Polyline vertices], and it would be pretty easy to make the Arc that follows those, and erase the Lines.

 

That assumes that the endpoints of the little Lines are on the arc path that it was converted from, within whatever fuzz factor is appropriate.

Kent Cooper, AIA
Message 3 of 6

The method to find the center will not work, the segments hvae different(random) angle and you are rigth, there will be a fuzz. Other idea could be that all lines in the arc are ENTNEXT and check each time the angle?

Message 4 of 6


@Caddhelp wrote:

The method to find the center will not work, the segments hvae different(random) angle and you are rigth, there will be a fuzz. Other idea could be that all lines in the arc are ENTNEXT and check each time the angle?


If the endpoints of the Lines are actually and accurately on the desired Arc path, then it doesn't matter that their angles [and lengths] vary.  The routine [when converted from working on Polyline segments to working on Lines] would find the intersection of the perpendicular bisectors of two of the Lines.  Oh-- no, wait, that one doesn't -- see the attached routine: TriangleCenters.lsp, with its TCI command for finding the Circumcenter of a Triangle.  If all Lines are chords, that intersection will be the center of the desired Arc.  The fuzz factor would be in testing for all Lines with both endspoints the same distance from there, and ignoring other Lines.  I think User selection of two Lines would be necessary -- I don't know how a routine could find two Lines applicable to the same Arc, out of a selection set of all Lines in the drawing.

 

Whether the (entnext) approach would work would depend on whether the conversion makes all the Lines coming from one Arc into sequential entities in the drawing file.  If there are never any short-enough Lines touching end-to-end that are not part of one of the desired Arcs (but that seems like a not-very-reliable assumption), I guess a routine could find the starting one for every Arc, and "chain" along subsequent Lines with shared endpoints.

Kent Cooper, AIA
Message 5 of 6

 

I will try to use the combination of the ENTNEXT (since the lines in arc are consecutive) and then use your method to check if they belong to the same arc. Then get StartPoint of the first segment, EndPoint of the last point and any point in the middle to build the arc. I just afraid it would work very slow.

 

 

I know, this program was badly needed by autocad users who use shape files for many many years. I thought, collectively,we can build something like that. I’m not a programmer, though in the past 20 years I wrote thousands of Lisp, VB and C programs for Autocad and Access. Maybe someone more knowledgeable could step in and solve this problem once for all?

 


Thanks to ALL.

 

Message 6 of 6

Ok, the use of both metods did work somehow.

 

I tested it on 2.6Mb file, the lisp created 738 arcs and analysed 53475 lines in about 1 minute, not bad.

The proccess involves Acad Map cleaning and then exploding of polylines.

 

Thanks Kent1Cooper for ideas.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost