DXF File Import Issues

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

DXF File Import Issues

GeoffatMM
Hi

I am a new user and am trying to see how LibreCAD works relative to my ancient copy of Autocad (2012).

I am trying to import a file from AutoCAD by converting it first to DXF format but there appear to be many options for the DXF type.  Can someone let me know what the most appropriate version of the DFX file is that I should use?  I am using ODA File Converter.  Should I select an ASCII or Binary format?  

2018 or 2013 or 2010 or 2007 or 2004?

Or should it be one of the R (revision?) types R14, R13, R12, R10 or R9?

I would add that it is doing something as there is a list of elements that I recognise on the RHS of the viewer together with these error messages (hence me wondering if it is a version issue).

File '' does not exist. Opening aborted
Hatch failed due to a gap=799.998 between (351814, -1.34001e+06) and (351818, -1.33921e+06)
Hatch failed due to a gap=3.378 between (351814, -1.34001e+06) and (351817, -1.34001e+06)
Hatch failed due to a gap=4.09484e-05 between (370953, -1.29938e+06) and (370953, -1.29938e+06)
Hatch failed due to a gap=4.09485e-05 between (319929, -1.29938e+06) and (319929, -1.29938e+06)
Invalid objects removed: 38
Loaded document: /Users/gjj/Desktop/FreeCAD Output/MM ALAMBIC CURRENT.dxf

Appreciate any help you can give me.

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
When you "Save as" dxf 2007 is the most recent version offered, so one can assume this is valid for opening also. ASCII or binary, I don't know.
LibreCAD can be picky on the way to open a file, whether from the program or via file. Sometimes "Recent files" work if unsuccessfully tried before.
LibreCAD is very sensitive to hatch outlines not exactly closed, maybe AutoCAD is more forgiving.

LordofBikes knows more about all this, so hopefully he will give you a more satisfying answer.
 
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
Thanks for the response.

i will experiment over the weekend and let you know how I get on.  

Much appreciated.

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
OK, I have experimented using ODAFileConverter and tried to generate DXF files of type binary and ASCII 2007, and R14 (also listed in the save as dropdown).

ODA manages the 2007 conversions but simply hangs on converting the R14 type so I have dropped trying it.

LibreCAD did not like the ASCII version and hung requiring a forced shutdown and restart.

The 2007 Binary seems to have imported properly as the errors are not showing and the layers and elements all appear to be listed BUT I cannot see anything!  I just have a blank page.

I have zoomed out as far as I can and tried to select items on the entire screen (using the green select all function) but nothing shows.  Here is the screenshot.



So no errors in bottom right for the three files I tried to open (the R14 was zero bytes so can be ignored).  The other two are the same file tried twice.

All the layers are listed and information appears to have been picked up correctly but I am presented with an empty page (unless I am missing something!).

Any ideas?

Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
You have very large coordinates showing at the bottom left indicator. Is this just because you have zoomed out very far? Otherwise it could indicate the file is of surveyor origin, and this causes the problem.
Have you tried "Auto Zoom "?
Check if you have a valid page size set in "Current Drawing Preferences". I have had cases with quirky drawings of other origin, where the main paper format box said A4, but the boxes below for separate paper width and height showed nonsense with something like 1e+xxx like in your grid status reading. I then switched to "Custom" in the main box and entered 297 and 210 in the separate boxes, and everything was fine.
What are your units?
Does the drawing open properly in AutoCAD itself, or more interesting, in other CAD than LibreCAD?
What is the outcome if you try to open the original dwg in LibreCAD? It has rudimentary dwg open capability, worth a try.
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
I tried the auto zoom but nothing happened.
Checked page size and it looked OK, I set it to A0 and no change set it to A4 still nothing.
Toggled draft mode and no change.
I have version 2.1.3 loaded on my iMac but it does not appear to recognise .dwg files as they are greyed out.  Is there some form of plugin I have to add to get it to recognise .dwg files?
This is why I am using ODA to convert to dxf format.
When I try to get Autocad to open the converted dxf file it hangs so there may simply be a problem with the conversion?  It crashed the software so I will try from fresh again in the morning.
I have posted the original dwg file opened in Autocad below.  I am not an experienced user but I understand that each of the surrounding white squares contains a drawing set to A0 and that the scale is 1:1.  I use the viewer window (the tabs at the bottom) to select sections that I need and print them to A4 size.

Don't know if you can see but this is Autocad 2012 running on Windows XP inside a virtual machine in my Mac so it can be pretty temperamental!  I cannot afford to purchase a new licence for the Mac (I am retired) and wanted to move to an open source alternative.  It looks like LibreCAD does all I need (I only prepare drawings for construction work I am doing on my house) but it would save me a lot of time if I could import the drawings (even if not perfectly) as redrawing the lot will be  a bit of a pain.

Are there any logs I can look at to see why the conversion is not being opened?  Getting my version of LibreCAD to read and open dwg files might be a good way forward.

Here is the drawing I am trying to import:




Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
So this morning I rebooted and restarted and Autocad successfully imported the converted dxf file.

I also noted your issue on the scaling numbers and zoomed back out but still nothing could be found by the auto zoom.  I inserted a 1 x 1 rectangle to make sure the scaling worked and it was fine.

Interestingly this morning I again got the error

     File '' does not exist. Opening aborted Saved drawing:

Second time I opened it, the error did not come up but nor did the drawing.

I am now saving the drawing from Autocad as dxf format to see if that makes any difference and will post results.

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
OK this is the output from this morning.

Saving from Autocad hangs with the R12 format but the 2000, 2004 and 2007 versions all saved successfully.

2000
I started with the 2000 version and success! It brought something in although tiny on the screen and with some hatching and invalid objects removed.  This is the error message it gave:

Hatch failed due to a gap=799.998 between (351814, -1.34001e+06) and (351818, -1.33921e+06)
Hatch failed due to a gap=3.378 between (351814, -1.34001e+06) and (351817, -1.34001e+06)
Hatch failed due to a gap=4.09486e-05 between (370953, -1.29938e+06) and (370953, -1.29938e+06)
Hatch failed due to a gap=4.09485e-05 between (319929, -1.29938e+06) and (319929, -1.29938e+06)
Invalid objects removed: 38
Loaded document: /Users/gjj/Public/Autocad Work/MBD/Alambic/MM ALAMBIC CURRENT 2000.DXF


2004
2004 gave similar results with this (identical) error message:

Hatch failed due to a gap=799.998 between (351814, -1.34001e+06) and (351818, -1.33921e+06)
Hatch failed due to a gap=3.378 between (351814, -1.34001e+06) and (351817, -1.34001e+06)
Hatch failed due to a gap=4.09486e-05 between (370953, -1.29938e+06) and (370953, -1.29938e+06)
Hatch failed due to a gap=4.09485e-05 between (319929, -1.29938e+06) and (319929, -1.29938e+06)
Invalid objects removed: 38
Loaded document: /Users/gjj/Public/Autocad Work/MBD/Alambic/MM ALAMBIC CURRENT 2004.DXF

2007
2007 results are the same with the same error message:

Hatch failed due to a gap=799.998 between (351814, -1.34001e+06) and (351818, -1.33921e+06)
Hatch failed due to a gap=3.378 between (351814, -1.34001e+06) and (351817, -1.34001e+06)
Hatch failed due to a gap=4.09486e-05 between (370953, -1.29938e+06) and (370953, -1.29938e+06)
Hatch failed due to a gap=4.09485e-05 between (319929, -1.29938e+06) and (319929, -1.29938e+06)
Invalid objects removed: 38
Loaded document: /Users/gjj/Public/Autocad Work/MBD/Alambic/MM ALAMBIC CURRENT 2007.DXF


The hatching is not an issue.  I can try to repair this and then import it again but is there anyway of knowing what the invalid objects are?  

It also seems to have stretched or moved items around (The white lines from the origin are not on the original drawing).  Any idea why this has happened?

Thanks for your help.  I have posted a screenshot of the 2007 import that I have "window zoomed".


Geoff


Finally imported something
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
I don't know how to find out what the invalid objects are.
I faintly remember having seen that with the lines to the origin sometimes before, but can't remember the abouts. You could look on which layer the are, maybe this helps to find out the reason. LibreCAD doesn't have the advanced layout features with grouping several drawings on one sheet and so on, this might produce queer results.
If the issue is not solved now for you, you could send me the original file, if you have no concerns, by email. It would be interesting to tinker around with it to get it working for LC, might learn something. Could try with Draftsight, more advanced than LC, Viewports and real paperspace. Free version, but not open source, no Mac version.
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
That's a kind offer.  The original dwg is 5.3 meg so could be emailed but the dxf expands to 53 meg so would have to be via ftp.

I have started working on the 2007 imported version but then have stopped as I am going through the user manual to make sure I understand the differences between LibreCAD and Autocad.

In terms of alternative software, I really want something that will run natively on my Mac.

I will break the main drawing down into several smaller ones as I can see the difference in performance between the one I have imported and new documents I am playing with.

I need an email address to send to?

One of the issues I am now having is that the drawing opens very small and on the left of the screen and when I try to use auto zoom, it always goes back to the same tiny, left sided image.  Is there a way to resize the canvas that the auto zoom is using relative to the drawing?  I cannot see why the auto zoom is not picking up the limits of my drawing (which is does for the new drawings I have produced?

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
If Autozoom shows a much larger area this indicates there is some "dark matter" outside, tiny remnants of deleted objects, or accidentally copied to beyond horizon, or circle centers of very flat arcs in the drawing. That last issue has been fixed a while ago, don't remember if it's already in V 2.1.3. Select all should show such entities.
Have sent you email adress via email.
Edit: Dwg is fine, dxf can be zipped a lot, I guess that's what dwg does under the hood.
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

LordOfBikes
Administrator
This last effect, where lines are misplaced to the origin looks like this issue: https://github.com/LibreCAD/LibreCAD/issues/940
It was caused by splines and solved in Sep. 2018. If this applies to your file, you can try the nightly build version which is available for Windows but sadly not for Mac.
It is 2.2.0 release candidate and as stable as 2.1.3, if not more.

Concerning the removed objects, there is no more information available.
From source I could see, that on file open all entities are scanned for valid extent values.
If one contains invalid data, it is removed from the document, but not more.
Hard to say, where these invalid data come from, without having the file.
They could be caused by the import library or unsupported entities.

Generally I have no experience with binary DXF, I don't have access to AutoCAD and I'm not sure if I ever saw a binary DXF.
I also don't know about issues with ASCII DXF, I would need to look into the file that hung to say more about this.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
A further update.

Thank you both for your responses.

Knowing it is a spline issue will guide me to check want parts are not transferred properly.  I need to check and redo parts of the whole drawing so having got where I am now with most of it in Librecad, I am happy.  i will however send the file to Dellus to play with.  Please do not spend too much time on it.

I cleaned up the 2007 version, removed the white lines to the origin, set what I wanted to see on the bench top and then copied that data to a new drawing and the auto zoom is now working fine on the new drawing.  Thanks for the guidance.  The original of the drawing came from someone else so I have no idea what else it was used for before I got it although that problem did not exist in Autocad.

As I have a virtual XP box on my Mac I will try the windows nightly build as well LoB.  I will also see if it is available in linux as I need to build a virtual linux box (Ubuntu probably) for some other issues I am playing with.

Still working through the tutorial which has been very helpful to convert me from Autocad.  I find this a good piece of software so far but will reserve final judgement until I finish the update of my building drawing.

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
Thanks for the file.
Opened in Draftsight with no fuss. Saved as ascii dxf, this hung on opening in LC. Saved as binary dxf, loaded in LC, showed layerlist but screen empty, select all gave no results. I think Draftsight uses the same import engine as Teigha.
I found some entities far out, about 32430000,1310000 and 774500,-2675000, deleted these as well as some nearer above the main drawing. Saved as dxf. Drawing was much more responsive then, even showed the satellite images, which it didn't before. During saving it complained about some files not found, missing external references?
But on opening in LC again no success.
Going out now. Will go on experimenting later.
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
Here is the final output I have achieved.  Now I can start to split it out and then check ithe individual drawings for any errors or omissions.

Dimensioning has not come across very well (Super tiny font size) but the rest looks reasonable.

Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

LordOfBikes
Administrator
Geoff,

the dimension font size can be adjusted. Go to Options -> Current Drawing Preferences, there is a tab Dimensions, where you can set all kind of dimension related options.

Do you permit that dellus forward your drawing to me for further investigation?
@dellus, I'm interested in both, the ascii DXF which hung and the binary DXF.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
Waiting for Geoff's permission.
Further experimenting I opened the original dwg in a linux community edition of QCAD. After starting you can evaluate the Pro features for a while (about 10 or 15 minutes). It offers many and up to date dwg and dxf in- and output options, also 2007, all marked as (Teigha). After playing around a bit I wanted to do a test save as dxf 2007 and had to notice it had ended evaluation mode and fell back to the free community edition mode. This offered as only dxf save option R15/2000 (dxflib)! I did so and the resulting file did open in LibreCAD, the only obvious issue was that most lines which should come up black on my light grey background were white. Fixable.
For comparison, I did the whole thing again with a fresh start, this time hurried and saved within evaluation time to R15 and 2007 both as Teigha. Upon opening in LibreCAD no joy, both hung. So it's something with Teigha files LibreCAD doesn't like.

In the original file there is an awful lot of stuff outside the main document area (the red rectangle?). Maybe auxiliary, temporary working space, depot for items, or are the block elements visible there? It would take a lot of time to find out what you can get rid of. So many layers too, I can see Geoff has reduced them in his latest screenshot.
 
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
In reply to this post by LordOfBikes
Apologies for the delay I have been busy on something else.

Happy or the file to be passed across.  Let me know if you find anything useful!

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

GeoffatMM
In reply to this post by LordOfBikes
My next problem is all about scaling.  i copied the skeleton layout at the very top right of the drawing (see previous post) and pasted it into a new drawing that had a reference layer with a drawn scale (0 to 600 on X and 0 to 300 on y axes).  On pasting, it overwrote reference layer (the layer still exists but the scale disappeared) and did not inherit the drawing dimensional information.  When I dimensioned a kitchen cabinet (600mm) it did it but I could not see the figures.  Eventually worked out that I needed to change the general scale to 100,000 i order for the other settings for text height etc. to work.  Measuring the cabinet gave 600,000 mm not 600 mm, a scale difference on 1000 not 100,000.

New drawings are set to meters and the drawing is set to millimetres, a scale difference of 1000 so nothing seems to match up.

I then went back to the original drawing I copied it from and set the general scale to 100,000 as well and now the dimension text is showing up but again the dimensions themselves are a scale of 1000 too large.

What do I have to do to the original drawing to get the scale correct?  I am sure if I solve this, the copy and paste will work (although the reference layer data will still be lost).

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: DXF File Import Issues

dellus
The original drawing is set up in mm. If you want to change it to meters, you have to scale it with the scale command completely by the factor 1/1000 = 0.001. In the Current Drawing Preferences - Dimensions leave General Scale at 50, as this is the scale the drawing is intended to be printed. But you have to change the values for the height / size of the dimension elements by the factor 0.001 also, as for instance the text height on paper formerly 2 mm has now to be expressed in meters, 0.002m.
Confusing, isn't it?
Instead of copy and paste you could also delete all the surrounding unwanted stuff and save under a new name. And move nearer to the origin.
 
12