DXF open from command line with old dxf parser #303

Open
martinstingl opened this Issue Feb 23, 2012 · 5 comments

Projects

None yet

3 participants

@martinstingl

Start librecad with the filename as command line parameter:
librecad topo.dxf
There are no objects shown in the drawing

Open the same file with the file menu:
Now the drawing contents are shown.

It seems that "New drawing exchange" is not used with the command line but is the default setting.
The file topo.dxf can be downloaded from https://launchpadlibrarian.net/26365610/topo.dxf

@Rallaz
Collaborator
Rallaz commented Feb 23, 2012

It seems that "New drawing exchange" is not used with the command line but is the default setting.

Yes, I send a patch to solve this issue, but the real problem is another:
Calling LC with a filename he tries to find the file type by extension, if the file is not a font is a old QCad dxf1,
then try to find out if it is a "normal" dxf, and your file is not.
"normal" dxf are simplified or complete.
Simplified: start with "ENTITIES", and have only the ENTITIES section (LC check for this from line 0 to 10)
Complete: contain all sections starting for HEADER section and LC find in the first 100 lines for the version
var "$ACADVER" not present in your file.

Edit your file whit text editor and change the start from:

0
SECTION
2
HEADER
9
$FILLMODE

to:

0
SECTION
2
HEADER
9
$ACADVER
1
AC1015
9
$FILLMODE

@Rallaz Rallaz added a commit to Rallaz/LibreCAD that referenced this issue Feb 23, 2012
@Rallaz Rallaz Fix issue #303 open from command line with new dxf parser 84152e3
@martinstingl

Now the modified DXF file gives not the same drawing compared to the original DXF file (when opened it with the file menu).
Most of the drawing entities are lost.

@Rallaz
Collaborator
Rallaz commented Feb 24, 2012

In your file I added the four lines for version, opening from command line:
"select->select all" say 168 entities length 231.615
an from "file->open" say 168 entities length 231.615, the same
Modified file (when closing the issue I'll delete):
http://sourceforge.net/projects/rallaz.u/files/snipets/topo_mod.dxf.zip

@martinstingl martinstingl reopened this Feb 29, 2012
@martinstingl

(Sorry, just closed accidentally.)
You have added one extra empty line at line number 1465 in your file topo_mod.dxf. With that line everything is OK.
When the line is not added, see http://sourceforge.net/projects/martinstingl.u/files/topo_modified.dxf.zip , the file opens with just 25 entities with a total length of 13.0253.
When I open the original file topo.dxf with "librecad topo.dxf" in bash or with the history in the file menu, no entities are shown at all. It seems that it is opened as a QCad 1.x file which is caused by the bad file structure so this is no bug.

When topo.dxf is opened with the file->open menu(New drawing exchange), 168 entities with a total lenght of 223.869 are shown. When I open your file topo_mod.dxf there are 168 entities with a total lenght of 223.869 and not 231.615 as you mentioned.

@r-a-v-a-s
Member

What is the status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment