View Issue Details

IDProjectCategoryView StatusLast Update
0001103DraftFeaturepublic2014-01-01 16:45
ReporteryorikAssigned Toyorik 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target Version0.14Fixed in Version0.14 
Summary0001103: Make a DWG importer/exporter based on the teigha convertor
DescriptionThe newly freely available multi-platform Teigha converter allows to make a script that imports and exports DWG files in freecad (converting them to/from a temp DXF file).

The script will not include anything (for license compatibility reasons), but will simply check for the presence of the teigha executable on start, and activate DWG support if it is found. If not, a notice is displayed, like the collada import script.
TagsNo tags attached.

Activities

danielfalck

2013-04-20 18:19

reporter   ~0003090

Last edited: 2013-04-20 18:23

The Teigha converter can be run from the command line:
Command Line Format is:
Quoted Input Folder
Quoted Output Folder
Output_version
{"ACAD9","ACAD10","ACAD12",
    "ACAD13","ACAD14",
    "ACAD2000","ACAD2004",
    "ACAD2007","ACAD2010"}
Output File type
{"DWG","DXF","DXB"}
Recurse Input Folder
{"0","1"}
Audit each file
{"0","1"}
[optional] Input file filter
(default:"*.DWG;*.DXF")

yorik

2013-04-20 18:23

administrator   ~0003091

This works:

TeighaFileConverter "/home/yorik" "/home/yorik" "ACAD2010" "DXF" "0" "1" "test.dwg"

The second number (audit) needs to be 1 otherwise it fails

danielfalck

2013-04-20 18:39

reporter   ~0003092

Here is the url for the converter:
http://www.opendesign.com/guestfiles/TeighaFileConverter

yorik

2013-04-21 15:44

administrator   ~0003093

Last edited: 2013-04-21 15:57

Linux version already working with commit e3dd819

Help wanted! See http://forum.freecadweb.org/viewtopic.php?f=10&t=3965

normandc

2013-04-21 19:32

manager   ~0003095

From Teigha File Converter page:
"DEB package: TeighaFileConverter_lnxX86_4.4dll_3.08.2_i386.deb

    Above installer was created for Linux Ubuntu 10.10 (x86 with 2.6 kernel)."

Are these people aware that Ubuntu 10.10 has not been maintained since 12 months ago?!?

Anyone tried installing it on a 64-bit system?

normandc

2013-04-21 19:52

manager   ~0003096

On Windows XP the default installation path is C:\Program Files\ODA\Teigha File Converter 3.08.2\TeighaFileConverter.exe.

The path is probably different on Windows Vista, Seven and 8. It is important to note that Windows users have the choice to change the install path.

I have no idea how to use the Windows console.

yorik

2013-04-21 19:56

administrator   ~0003097

It installed fine on my debian 64bit... About the console, just search for "cmd" in the start panel, IIRC

normandc

2013-04-21 20:11

manager   ~0003099

I know how to call a Windows console, what I'm saying is I have no idea what to do *in it*. The Unix/Linux syntax obviously does not work. My DOS days are a couple decades ago.

normandc

2013-04-21 20:35

manager   ~0003100

Last edited: 2013-04-21 20:36

OK found it. The problem is with spaces in the Windows console. The executable path needs to be put in brackets too for it to work:

"C:\Program Files\ODA\Teigha File Converter 3.08.2\TeighaFileConverter.exe" "Path-To-Input-Directory" "Path-To-Output-Directory" "ACAD2010" "DXF" "0" "1" "Name-Of-A-Test-File.dwg"

Notice that the paths use backslashes rather than slashes.

Unfortunately the only DWG test file I have is massive, the resulting DXF is more than 8MB and FreeCAD chokes on it. It's good though, IĀ opened it in Teigha Viewer.

shoyurbanana

2013-05-31 12:55

reporter   ~0003186

Last edited: 2013-05-31 15:13

Can you please help me, why doesnt that work then...

C:\"Program Files (x86)"\ODA\"Teigha File Converter 3.09.0"\TeighaFileConverter "C:/test" "C:/test" "ACAD2010" "DXF" "0" "1" "22072-C32-00 RELEASE TESTER.dwg"

I also tried without the file at the end, or with "*.DWG", or slashes, backslashes, many many other ways, whatever i do, it keeps popping the command line format window...

Thank you !!! {"mmmm"}

I need this command to work to retreive tons of parameters in tons of DWG files, , ill use the command in excel vba to fill tables. but the commmand doesnt work :*(

yorik

2013-08-09 23:08

administrator   ~0003446

Hm I should work further on this...
I have no idea how to locate an executable on windows if it's not in a standard path. Maybe we can search for it in a standard location and add a preference setting so the user may set his own path...

yorik

2013-08-24 19:50

administrator   ~0003514

I just added in commit 47fd378 a preferences setting (Draft->Import options) to set the path to the TeighaFileConverter.exe utility manually. This should enable dwg import on non-linux systems.

If you guys could test, I'd be grateful!

bejant

2013-08-27 03:05

reporter   ~0003522

I tried to open a .dxf on an XP system with these specs:
Version 5.1 (Build 2600.xpsp_sp3_qfe.130704-0421 : Service Pack 3
And when I opened FreeCAD and tried to OPEN a .dxf file (Dafault = Part Workbench)this is what appeared in the report window from when I first launched FreeCAD:

matplotlib not found, Plot module will be disabled
pycollada not found, collada support will be disabled.
downloading https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/dxfColorMap.py ...
Download of dxf libraries failed. Please download them manually from https://github.com/yorikvanhavre/Draft-dxf-importerTraceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\FreeCAD0.13\Mod\Draft\importDXF.py", line 62, in <module>
    sys.exit()
<type 'exceptions.SystemExit'>: <unknown exception data>
Stack Trace: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\FreeCAD0.13\Mod\Draft\importDXF.py", line 62, in <module>
    sys.exit()


I closed FreeCAD and started a new session of FreeCAD. Default workbench is still the Part Workbench. This time I select File -> New. (Unless I do File -> New, the option to select File -> Import is greyed out). Now I can select File -> Import a .dxf file and everything in my Report View is:

matplotlib not found, Plot module will be disabled
pycollada not found, collada support will be disabled.
downloading https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/dxfColorMap.py ...
Download of dxf libraries failed. Please download them manually from https://github.com/yorikvanhavre/Draft-dxf-importerTraceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\FreeCAD0.13\Mod\Draft\importDXF.py", line 62, in <module>
    sys.exit()
<type 'exceptions.SystemExit'>: <unknown exception data>
Stack Trace: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\FreeCAD0.13\Mod\Draft\importDXF.py", line 62, in <module>
    sys.exit()


OS: Windows XP
Platform: 32-bit
Version: 0.14.2370 (Git)
Branch: master
Hash: a836759ebd91404954a778ff8885e152611576e1
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.5.1




I'd like another user to confirm this behavior...

bejant

2013-08-27 03:08

reporter   ~0003523

I apologize, the hyperlinks above were created automatically; I only cut and pasted from the Report View window. My intention was for them to be posted simply as text.

yorik

2013-09-06 19:00

administrator   ~0003558

Last edited: 2013-09-06 19:02

That problem is not related to the DWG importer. Please keep separate problems in separate topics...

The message says what the problem is, the download of some libraries failed. Probably the server was down at the time you tried... Can you try again?

yorik

2013-12-20 21:21

administrator   ~0003956

Closing because it seems to be working ok now. Please reopen this topic if problems arise.

Issue History

Date Modified Username Field Change
2013-04-20 18:07 yorik New Issue
2013-04-20 18:07 yorik Status new => assigned
2013-04-20 18:07 yorik Assigned To => yorik
2013-04-20 18:19 danielfalck Note Added: 0003090
2013-04-20 18:20 danielfalck Note Edited: 0003090
2013-04-20 18:23 yorik Note Added: 0003091
2013-04-20 18:23 danielfalck Note Edited: 0003090
2013-04-20 18:39 danielfalck Note Added: 0003092
2013-04-21 15:44 yorik Note Added: 0003093
2013-04-21 15:57 yorik Note Edited: 0003093
2013-04-21 19:32 normandc Note Added: 0003095
2013-04-21 19:52 normandc Note Added: 0003096
2013-04-21 19:56 yorik Note Added: 0003097
2013-04-21 20:11 normandc Note Added: 0003099
2013-04-21 20:35 normandc Note Added: 0003100
2013-04-21 20:36 normandc Note Edited: 0003100
2013-05-31 12:55 shoyurbanana Note Added: 0003186
2013-05-31 12:56 shoyurbanana Note Edited: 0003186
2013-05-31 12:58 shoyurbanana Note Edited: 0003186
2013-05-31 15:13 shoyurbanana Note Edited: 0003186
2013-07-05 22:11 yorik Project FreeCAD => Draft
2013-08-09 23:08 yorik Note Added: 0003446
2013-08-24 19:50 yorik Note Added: 0003514
2013-08-27 03:05 bejant Note Added: 0003522
2013-08-27 03:08 bejant Note Added: 0003523
2013-09-06 19:00 yorik Note Added: 0003558
2013-09-06 19:00 yorik Status assigned => feedback
2013-09-06 19:02 yorik Note Edited: 0003558
2013-12-20 21:21 yorik Note Added: 0003956
2013-12-20 21:21 yorik Status feedback => assigned
2013-12-20 21:21 yorik Status assigned => closed
2013-12-20 21:21 yorik Resolution open => fixed
2013-12-20 21:21 yorik Fixed in Version => 0.14
2014-01-01 16:42 raulshc Tag Attached: file format
2014-01-01 16:42 raulshc Tag Detached: file format