DeviousAlpha Posted November 30, 2011 Posted November 30, 2011 Hello everyone, Let me preface this by saying I am completely new to AutoCAD and have only been experimenting with it these last 2-3 days at work. And apologising if I've put this in the wrong section. I have been given a 2D DXF file with the design of an ion source. I have removed large parts of the design as I only need to electrode shapes. I need to import the electrodes as a 2D DXF into my code to run simulations with them. However... The code can read layers, and it searches for a closed loop within a layer and uses that to shape its electrodes. So I have isolated each electrode and saved them.The issue I'm having is the code finds no closed loops. Further investigation let me to the close, fillet, and boundary commands. Which I assumed would do the trick. However after a number of hours I am no closer to my goal. I have isolated the problem to be linking a semi-circle to 2 lines. Because if I remove the semi-circle and replace with a straight line code will happily detect a closed loop. I have converted the entire thing into 1 polyline, and then to make sure its closed I have used the boundary command to create a polyline outline of the shape. Even then, it is apparently not a closed loop. I was wondering if there is a glaringly obvious mistake I am making here, or if it comes down to resolution within the code. I'm looking into part 2, but I thought I'd post this here while I do that and see if someone can point me in the right direction. Thanks for any help! Quote
CyberAngel Posted November 30, 2011 Posted November 30, 2011 For some reason AutoCAD has a lot of trouble detecting the exact point where an arc ends. You can use a line to trim (cut) an arc, but when you try to join the arc to the line in a polyline, it will often refuse. In your case, is it possible to limit the precision of the coordinates? AutoCAD will use the tiniest gap to keep two objects apart. If you convert/truncate the numbers, say from double float to float, that gap should disappear. Quote
Grant Posted December 1, 2011 Posted December 1, 2011 I also have a lot of problems with arcs meeting lines - as I have a lot of them in the type of drawing I do. I have found that when you polyline it you need to list the polyline and make sure it is 'closed' not 'open'. Some ways to find where the problems are: Find the problem PE - polyedit Pick Polyline with the problem E - edit vertex Where the big 'X' is is where the problem is. When trying to fix the problem you can - drag through grips the arc to the end point of the line (note: this may make the arc slightly out in size eg 2mm rad may become 1.99999999mm) - redraw the area but don't use the fillet command as this I have found is one of the problems. This problem has been around for all the 20 years I have been using Autocad! Hope this helps Quote
Organic Posted December 1, 2011 Posted December 1, 2011 If you have a closed polyline, then perhaps the problem is that your other piece of software (not AutoCad) simply only recognizes lines, not arcs. Quote
DeviousAlpha Posted December 1, 2011 Author Posted December 1, 2011 I managed to get the first extractor loaded up after tweaking it, and it has an arc. I'll have to try the polyedit suggested by Grant. Thanks folks, I'll be back in a bit with the results. Quote
DeviousAlpha Posted December 1, 2011 Author Posted December 1, 2011 Well your method has highlighted an X Grant, but now I can't get rid of the thing. Hah. Quote
DeviousAlpha Posted December 1, 2011 Author Posted December 1, 2011 Well thanks a heck of lot to you all, once I had highlighted the problem vertex, while I was unable to get rid of it I could move it. Eventually I moved it completely away from the arcs, and it was simply at the join of two lines. With the vertex there the program was able to read it in no problem. Top form, and thanks again to you all! 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.