FC import DWG without Layers Objects

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

FC import DWG without Layers Objects

Post by jtm2020hyo »

I tried to import a DXF, but I found that the MESH workbench can not load, any solution?
Last edited by jtm2020hyo on Sat Jan 28, 2023 2:16 pm, edited 1 time in total.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Mesh Workbench load error

Post by drmacro »

jtm2020hyo wrote: Fri Jan 27, 2023 5:50 pm I tried to import a DXF, but I found that the MESH workbench can not load, any solution?
File>Import>dxf

DXF is a vector format file, not a mesh.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: Mesh Workbench load error

Post by jtm2020hyo »

the script to import load draft, mesh and part, then appears error with mesh.

when I tried to load manuall mesh WB appears error "dll not found"


Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: Spanish/Peru (es_PE)
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Mesh Workbench load error

Post by drmacro »

jtm2020hyo wrote: Fri Jan 27, 2023 6:04 pm the script to import load draft, mesh and part, then appears error with mesh.

when I tried to load manuall mesh WB appears error "dll not found"

...
Why are you using Mesh workbench? DXF files are not meshes.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Mesh Workbench load error

Post by Syres »

drmacro wrote: Fri Jan 27, 2023 6:33 pm Why are you using Mesh workbench? DXF files are not meshes.
The DXF Legacy (Python) importer uses it, see https://github.com/FreeCAD/FreeCAD/blob ... DXF.py#L56 and https://github.com/FreeCAD/FreeCAD/blob ... F.py#L1196

The root cause could well be the CPU instruction set the OP's box uses but I'll only know when I get chance to reboot back in my Windows partition.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Mesh Workbench load error

Post by drmacro »

Syres wrote: Fri Jan 27, 2023 6:53 pm
drmacro wrote: Fri Jan 27, 2023 6:33 pm Why are you using Mesh workbench? DXF files are not meshes.
The DXF Legacy (Python) importer uses it, see https://github.com/FreeCAD/FreeCAD/blob ... DXF.py#L56 and https://github.com/FreeCAD/FreeCAD/blob ... F.py#L1196

The root cause could well be the CPU instruction set the OP's box uses but I'll only know when I get chance to reboot back in my Windows partition.
Ah..ok, sorry. :oops:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: Mesh Workbench load error

Post by jtm2020hyo »

is there any alternative or how can I fix Mesh Workbench??


PD: here the error log

Code: Select all

14:07:40  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\JTM\AppData\Local\Programs\FreeCAD 0.20\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\Users\JTM\AppData\Local\Programs\FreeCAD 0.20\Mod\Draft\importDXF.py", line 56, in <module>
    import Part, Draft, Mesh
  File "C:\Users\JTM\AppData\Local\Programs\FreeCAD 0.20\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
<class 'ImportError'>: DLL load failed while importing Mesh: The specified module could not be found.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Mesh Workbench load error

Post by Syres »

jtm2020hyo wrote: Fri Jan 27, 2023 7:08 pm is there any alternative or how can I fix Mesh Workbench??
Yep, you can use the C++ DXF importer by unchecking the Legacy in Edit > Preferences as per screenshot:

DXFImporterChoice.jpg
DXFImporterChoice.jpg (59.27 KiB) Viewed 917 times

I see you appear to have installed FreeCAD as a user and not as an adminstrator for all users, this could be why I can't replicate the fault.


If you have Administrator access then I would suggest deinstalling FreeCAD and re-installing for All Users which should suggest C:\Program Files\FreeCAD 0.20 as default installation path rather than your user profile area.

Code: Select all

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.60f
  * Assembly3 0.11.4
  * CfdOF 1.20.4
  * Curves 0.6.4
  * fasteners 0.4.25
  * fcgear 1.0.0
  * freecad.xray 2022.4.17
  * Help 1.0.3
  * Manipulator 1.4.9
  * Plot 2022.4.17
  * sheetmetal 0.2.59
  * Silk 1.0.0
  * timber
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: Mesh Workbench load error

Post by jtm2020hyo »

with and without legacy appears same error with MESH WB, but only if use ODA converter.


only curiosly, why is need a converter to import dwg/dxf? to what format is converting ODA to do it manually?

Or how to fix Mesh WB?
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: Mesh Workbench load error

Post by jtm2020hyo »

Finally I imported my DWG file to Freecad updating my version to pre-release:

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31695 (Git)
Build type: Release
Branch: master
Hash: 64caea207394bb05587c8ffb29b7a3e8696d24df
Python 3.10.8, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Spanish/Peru (es_PE)

... but everything is imported as shapes objects, how can I import my dwg with Layers and others properties?
Post Reply