Incompatible dxf file (v 2.x)?

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

Incompatible dxf file (v 2.x)?

Zmogas
Hello,

 when I used LC 1.x then I was able to import dxf file (created with LC) in to other applications like Inkscape, LO Draw, open with DXF2SCR (tool for Eagle).

 Now with LC 2.0.0beta1 (Compiled on: Dec 13 2012) in other apps I got empty pages after import (opening in LC shows that drawing is OK).

 This is bug in LC?
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Rallaz
LC 2.0.0beta1 uses a new dxf library that support more dxf versions and seems full compatible whit original format form AutoDesk.
You can attach a non working dxf to check?

Remember: in LC 2.0.0beta1 default version are dxf2007 but you can save in 2004, 2000, R14 & R12
LC 1.x only save in 2000 & R12
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
To test I used:
 - LibreOffice Draw v3.6.4.3;
 - Inkscape v0.48+devel r11993.

Tested two files with same drawing (rectangle) in same format (DXF 2000):
 - test__v1.0.2__dxf2000.dxf created with Librecad v1.0.2;
 - test__v2.0.0.beta1__dxf2000.dxf created with LibreCad v2.0.0.beta.

 When I open first test file then I got what I expected - rectangle.
 But when I open second file then I got an empty page (I got no warnings or errors). In XML editor of Inkscape I see four paths with enormous values (like 3e20) of coordinates.

 I use Linux 3.5.0-21-generic, Kubuntu 12.10.
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Rallaz
My test:
OpenSuse 64bits and KDE 4.7.2
LibreOffice Draw v3.5:build-413
Inkscape 0.48.2-r9819
See screenshot:


You can see in kwrite:
v1.0.2  => saved with dxflib2.2.0.0 in version 2000 (ACADVER AC1015)
v2.0.0beta => saved with dxfrw 0.5.4 in version 2007 (ACADVER AC1021)
This is a problem with KDE always return the first filter that matches the pattern (*.dxf)
to solve require to build LC with DEFINES += USEQTDIALOG=1 uncommenting
line #17 in src.pro

In inkscape are imported from -10,-10 to 10,10 mm or -35.933,-35.933 to 35.933,35.933 pixels
in a document 744x1052 pixels

And in LO draw are imported scaled and centered with line style invisible!!!
Drag over the sheet to select, then change  line style
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
 Ha, indeed in Draw imported lines are invisible ("Line Style" appears "Invisible"), I thought ".. nothing is imported..".

 I found that in Inkscape problems occurs when option "Use automatic scaling to size A4" is checked (then I get like 3.5e20 coordinates), when unchecked drawing is imported correctly. With "dxflib" version that option causes no problem. Something is missing in "dxfrw"...?

 So resolution, I think, is lack of proper support of DXF2000 in apps when importing.

 Why "USEQTDIALOG=1" is not active by default, it causes other problems?

 
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Rallaz
Ok, today I send a patch to solve the "problem" and save correct values

Explanation:
in new lib (dxfrw) vars EXTMIN and EXTMAX are set with invalid values (like empty draw)
and in old library simply NOT set

LO draw and Inkscape (scaling to A4) if these vars do not exist loads the dxf file, then calculate
scale to fit in page and apply in all entities.
But if these vars exists both asumes are correct values and first calculate the scale then loads
applying a wrong scale.

At the momment you can solve opening your LC2_beta1 files whit kwrite or similar and remove these
lines:



I can't set "USEQTDIALOG=1" active by default because the problem is present only in KDE
With "USEQTDIALOG=0" are used the native system file dialog and this is the more correct
in windows, MacOsX and in linux based in GTK, I think the solution is detect KDE use
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
 Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Rallaz
Hello Zmogas,

I found a solution for file dialog and KDE:

In KDE open "system settings" and select "File Associations"
then add a new  "file association" (Aka mime type)

In "Group" select image and in "Type name" write vnd.dxf

Select the new created mimetype (you can found on bottom of image group)
and in "General" tab add:
"Filename Patterns" => *.dxf
"Description" => DXFr12 vectorial image
"Application Preference Order" => at your discretion

Repeat all adding more  mimetype with name vnd.dxf
and changing "Description" for:
DXFr14 vectorial image
DXFv2000 vectorial image
DXFv2004 vectorial image
DXFv2007 vectorial image

To test open LC and save as... then open with an text editor and check $ACADVER var.
Values are:
AC1009 for r12, AC1014 for r14, AC1015 for 2000, AC1018 for 2004 & AC1021 for 2007
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
Hello,

I tried to add those mimetypes (there was already one "vnd.dxf" by factory), but no success - when I reopen settings panel I realise that all my work is gone. Maybe there must be only one "vnd.dxf"..?

KDE 4.9.5
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Rallaz
Yes, you are rigth, do not work :(

Simply wait for new version, I added code to detect KDE use and automaticaly switch
into native or QT filedialog.

If you use daily builds in 1-2 days are ready
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
I'm Still waiting for repository update...
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
Hello,

finally I got update, and it worked. Thanks.

One more question: create new drawing, save it, then again "save as" to same file but with different DXF version - as result DXF version in file not changes. Is it should be?
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Rallaz
currently if the file name is the same and the file is unchanged does nothing.

I added a patch to force write if "save as" are select, if the file is unchanged and you click "save"
does nothing.

Wait for a new build to test.

Also I added a patch to prevent crash when save as dxfR12 and have opened spline
Reply | Threaded
Open this post in threaded view
|

Re: Incompatible dxf file (v 2.x)?

Zmogas
Works well. Thank You!