View Issue Details

IDProjectCategoryView StatusLast Update
0002822FreeCADBugpublic2017-01-02 12:53
ReporterAlfredoC Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSOpensuseOS VersionLeap 42.2
Product Version0.17 
Summary0002822: can't import dxf files
DescriptionTry to open a dxf file throws an error to the status bar "Gui::Command::activated(0): unknown C++ exception thrown.
Same happens when I try to import this file
TagsNo tags attached.
FreeCAD Information

Relationships

has duplicate 0002824 closedyorik DXF Can't be imported or opened 

Activities

yorik

2016-12-31 01:54

administrator   ~0007562

DXF import works normally for me.
Can you attach here the dxf file that gives problems?

Dansic

2016-12-31 16:56

reporter  

Import-Export_DXF.png (Attachment missing)

Dansic

2016-12-31 17:11

reporter   ~0007563

I have the same issue whether I am importing the DXF file into an existing document or opening it as a new document.

The files I am trying to import are the cooktop.dxf and sink.dxf used in the "FreeCAD - A Manual":

https://github.com/yorikvanhavre/FreeCADmanual/blob/master/files/sink.dxf
https://github.com/yorikvanhavre/FreeCADmanual/blob/master/files/cooktop.dxf

When trying to import (File -> Import and then selecting a file) or (File -> Open and then selecting a file) things seem to work but nothing is happening except an automatic View Fit.

Nothing is added to the 3D view and no error notification is issued. Nothing is added to the Model Tab of the combo view.

Nothing is reported in the Python Report View

The following is shown in the Python Console view:

>>> import importDXF
>>> importDXF.insert(u"C:/Users/.../FreeCAD/sink.dxf","sink")
>>> Gui.SendMsgToActiveView("ViewFit")
>>>

***Remark: the "..." in the paht of importDXF.insert command are from me to remove a long string of path components

I have upload a screen capture of the preferences setting after I have unchecked the two upper check box (Show this dialog... and Use legacy Python...) that are set by default in the downloaded version of FreeCAD.

Here are my FreeCAD info:

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

yorik

2016-12-31 17:47

administrator   ~0007564

Last edited: 2016-12-31 17:49

oh ho--- the problem is not the DXF importer, but those files! I forgot to "purge" them apparently...

If you mark the "group layers into blocks" DXF option, it works fine. But if not, the importer creates about 6700 shapes! All the blocks present in the file are imported. On my machine it doesn't produce an error, but takes many minutes to process and eats a lot of memory.

The legacy importer doesn't have this bug and also works fine.

I am now fixing this to skip importing blocks that have no instance in the document.

Related Changesets

FreeCAD: master 2982ecf6

2016-12-31 18:48:01

yorik

Details Diff
Draft: Do not import non-instanciated blocks - fixes 0002822 Affected Issues
0002822
mod - src/Mod/Draft/App/DraftDxf.cpp Diff File

Issue History

Date Modified Username Field Change
2016-12-30 19:59 AlfredoC New Issue
2016-12-31 01:54 yorik Note Added: 0007562
2016-12-31 01:54 yorik Assigned To => yorik
2016-12-31 01:54 yorik Status new => feedback
2016-12-31 16:56 Dansic File Added: Import-Export_DXF.png
2016-12-31 17:11 Dansic Note Added: 0007563
2016-12-31 17:47 yorik Note Added: 0007564
2016-12-31 17:48 yorik Changeset attached => FreeCAD Master master 2982ecf6
2016-12-31 17:48 yorik Status feedback => closed
2016-12-31 17:48 yorik Resolution open => fixed
2016-12-31 17:49 yorik Note Edited: 0007564
2017-01-02 12:53 yorik Relationship added has duplicate 0002824