Open *.Dwg with Qcad Pro in FCAD

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Open *.Dwg with Qcad Pro in FCAD

Post by thomas-neemann »

here is a posibility for 3D-DWG

https://forum.freecadweb.org/viewtopic. ... 10#p417264


edit

via ifc


https://www.youtube.com/watch?v=UkLlxGo5ZPE

phpBB [video]
Last edited by thomas-neemann on Tue Jan 25, 2022 9:43 am, edited 1 time in total.
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Open *.Dwg with Qcad Pro in FCAD

Post by dimitar »

yorik wrote: Mon Jan 24, 2022 12:55 pm Can you check if any error message appears in the report window?
Other thing to test is with a file path that has no spaces or special characters in it, does it work any better?
the syntax of dwg2dwg is very simple, so one can also test in a terminal:
C:\path\to\...\dwg2dwg.exe -o "C:\path\to\some\file.dxf" "C:\path\to\some\file.dwg"
On windows, there's a file called dwg2dwg.bat, which contains the following info:

Code: Select all

@echo off
qcadcmd.com -no-gui -allow-multiple-instances -autostart scripts\Pro\Tools\Dwg2Dwg\Dwg2Dwg.js %0 %*
the folder it specifices scrpts\pro\tools\dwg2dwg doesn't exist, or i cant find it in inside of the qcad folder.

specificying the dwg2dwg.bat file in freecad
FreeCAD_ioiIb3qukS.png
FreeCAD_ioiIb3qukS.png (7.46 KiB) Viewed 2712 times
tested dwg2dwg.bat in the command prompt and it works:

Code: Select all

C:\Users\dimitar\Documents\_apps\qcad-3.27.1-pro-win64\dwg2dwg.bat -o c:\users\dimitar.pouchnikov\desktop\test1.dxf c:\users\dimitar\desktop\test1.dwg
QCAD version  3.27.1
18:44:31: Debug:    Input file:  c:\users\dimitar\desktop\test1.dwg
18:44:31: Debug:    Output file:  c:\users\dimitar\desktop\test1.dxf
18:44:31: Debug:    DXF/DWG Release:  R27
18:44:31: Debug:    calling odInitialize
18:44:31: Debug:    dropped global XDATA (no res buf):  "ViewportCenter"
Warning:  old and new property values for property  "Arrow block"  have different types: QString  vs.  int
Conversion finished.
With the same simple circle DWG file, I get the following error in Freecad:

Code: Select all


Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\dimitar\Documents\_apps\FreeCAD_0.20.26858_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\importDWG.py", line 106, in insert
    doc = importDXF.insert(dxf, docname)
  File "C:\Users\dimitar\Documents\_apps\FreeCAD_0.20.26858_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\importDXF.py", line 2845, in insert
    Import.readDXF(filename)
<class 'RuntimeError'>: File doesn't exist

User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Open *.Dwg with Qcad Pro in FCAD

Post by ragohix769 »

yorik wrote: Mon Jan 24, 2022 12:55 pm
Can you check if any error message appears in the report window?
I'm on Linux, and pointing on dwg2dwg, create a freeze (or illimited waiting) on Fcad while opening a dwg file. I've not tested using it directly by shell console, I'll try.
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Open *.Dwg with Qcad Pro in FCAD

Post by ragohix769 »

Roy_043 wrote: Mon Jan 24, 2022 12:56 pm
ragohix769 wrote: Mon Jan 24, 2022 10:31 am You can test it with any *.dwg that you have.
What I meant: I am interested in seeing a DWG that ODA cannot import properly.
Yes base geometry normally is good with ODA, but text, quotation, layers, etc etc, not so good (in my experience, at least). With Qcad I've opened some Dwg that ODA was imported not so good (pity I cannot post it here, because these are works/files from other clients, not mine), and Qcad it's really fast, you can erase things very quickly. What is not good with Qcad, IMHO, is that a lot of times texts imported (only from dwg made with recent Autocad versions) are giant (in my experience, I repeat).

I really hate dwg and lock-in/proprietary standard.
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Open *.Dwg with Qcad Pro in FCAD

Post by thomas-neemann »

ragohix769 wrote: Mon Jan 24, 2022 11:40 pm

I really hate dwg and lock-in/proprietary standard.
that's the way it is with me too, so in my opinion freecad will change the cad landscape as radically as linux changed the server landscape.
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Open *.Dwg with Qcad Pro in FCAD

Post by yorik »

Thanks for testing guys! What I can gather so far:

- on windows one has to use the dwg2dwg.bat
- on linux too, the dwg2dwg util is a bash script. Unded the hood it launches the qcad main executable with the -no-gui option and executes a Dwg2Dwg.js script.
- the script works on windows too when used in a terminal

So most probably the problem is when FreeCAD calls the dwg2dwg script. I'll add more debugging info to importDWG.py so we can look further
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Open *.Dwg with Qcad Pro in FCAD

Post by ragohix769 »

yorik wrote: Tue Jan 25, 2022 10:34 am Thanks for testing guys! What I can gather so far:

- on windows one has to use the dwg2dwg.bat
- on linux too, the dwg2dwg util is a bash script. Unded the hood it launches the qcad main executable with the -no-gui option and executes a Dwg2Dwg.js script.
- the script works on windows too when used in a terminal

So most probably the problem is when FreeCAD calls the dwg2dwg script. I'll add more debugging info to importDWG.py so we can look further
I've tested more (I'm on Linux) the dwg2dwg lib, and yes it works in the end :D (but importing directly in Fcad by Qcad pro lib, it's really really slow, it' takes a lot of minutes on my Ryzen7 workstation with 32 GB of ram)

But it import "only" geometry, al text and all layers and other thing in dwg, are gone. So at the end it's more useful (to get all the info in the dwg), IMHO, to open the dwg with Qcad pro directly, preprocess all the info that you need there (it's very quickly BTW, Qcad pro it's really a good SW) and then export to dxf to import in Fcad. It's not a very good process, because you need a lot of work to setup all in Fcad and continue working on dwg from other people, and I really hate this, but this workaround it's working.

Of course having more debugging info will be very useful to have a better import. But the big issue here for what I see, IMHO, it's having a better dxf importer/exporter that can get/send all the 2d info in a Fcad file.
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Open *.Dwg with Qcad Pro in FCAD

Post by yorik »

ragohix769 wrote: Tue Jan 25, 2022 11:42 am but importing directly in Fcad by Qcad pro lib, it's really really slow, it' takes a lot of minutes on my Ryzen7 workstation with 32 GB of ram
Do you use the legacy python dxf importer?
The newer, c++ one is super fast, specially with the "group layers into blocks" option... Here are my settings:
Screenshot from 2022-01-25 12-50-54.png
Screenshot from 2022-01-25 12-50-54.png (130.65 KiB) Viewed 2495 times
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Open *.Dwg with Qcad Pro in FCAD

Post by thomas-neemann »

ragohix769 wrote: Tue Jan 25, 2022 11:42 am ...But it import "only" geometry, al text ..... are gone. ...
usually the dwg is not 1:1, then the text would be unusable when scaling. if you work with image everything is there

test dwg file https://dwgmodels.com/250-apartment-bui ... cades.html



3.png
3.png (130.43 KiB) Viewed 2445 times
4.png
4.png (42.79 KiB) Viewed 2444 times

btw: in this example you can see that the beams in dwg files are often cheated
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Open *.Dwg with Qcad Pro in FCAD

Post by ragohix769 »

yorik wrote: Tue Jan 25, 2022 11:52 am
ragohix769 wrote: Tue Jan 25, 2022 11:42 am but importing directly in Fcad by Qcad pro lib, it's really really slow, it' takes a lot of minutes on my Ryzen7 workstation with 32 GB of ram
Do you use the legacy python dxf importer?
The newer, c++ one is super fast, specially with the "group layers into blocks" option... Here are my settings:
Screenshot from 2022-01-25 12-50-54.png
I use the legacy, maybe it's time to use the newer one!
I'll test it with your settings, thanks a lot for the tips :-)
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
Post Reply