CAD Exchanger addon

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: CAD Exchanger addon

Post by steve123 »

Hi,

Unfortunately, this does not appear to work with a SolidWorks file I tried. It could be the plugin is not working at all, I am not certain but I think this is likely the case.

I can run CADExchanger manually and open a SLDASM or SLDPRT file. I attached a screen shot of CADExchanger with the open SLDASM file.
Screen Shot 2021-02-18 at 7.59.19 AM.png
Screen Shot 2021-02-18 at 7.59.19 AM.png (140.19 KiB) Viewed 6526 times
However, this file type and the SLDPRT file type do not appear in the list of supported file types in File->Open, File->Import or File->Export

The CADExchanger app is set in the preferences. I do not see an error message(s) in the python console. There doesn't appear to be any invocation of CADExchanger but I suppose there wouldn't because I cannot open the SLDASM file.

I removed the CADExchanger app path from the preferences. Restarted FreeCAD. Added the app path again. Restarted. Same issue.

Here is the python console after starting FreeCAD and adding the app path:

Code: Select all

Python 3.9.1 (default, Feb 15 2021, 10:22:54) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> Gui.runCommand('Std_Workbench',9)
>>> Gui.runCommand('Std_ViewStatusBar',1)
>>> Gui.runCommand('Std_DlgPreferences',0)
>>> 
After saving the preferences, the last line ("Std_DlgPreferences") in the console appeared. I cannot tell if that indicates it ran the plugin to fetch the file types or not. But otherwise, no indication it attempted to run CADExchanger or anything else happened.

OS: macOS 11.2
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24104 (Git)
Build type: Release
Branch: master
Hash: 35c1a005f1bf45e8438ad21066dbbc63564db842
Python version: 3.9.1
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.0
Locale: English/Canada (en_CA)
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: CAD Exchanger addon

Post by steve123 »

I reviewed the workflow on the GitHub repo that indicates the plugin converts to BREP. So, I used the CADExchanger GUI to convert the SLDASM file to BREP. I could then open the BREP file.

However, this conversion doesn't appear to maintain the part and assembly hierarchy of the SLDASM file. Rather, the import is a compound object that has no tree. So, the individual parts cannot be modified or edited.
Attachments
Screen Shot 2021-02-18 at 8.31.32 AM.png
Screen Shot 2021-02-18 at 8.31.32 AM.png (655.07 KiB) Viewed 6527 times
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: CAD Exchanger addon

Post by sgrogan »

steve123 wrote: Thu Feb 18, 2021 3:34 pm However, this conversion doesn't appear to maintain the part and assembly hierarchy of the SLDASM file. Rather, the import is a compound object that has no tree. So, the individual parts cannot be modified or edited.
Somethings to maybe try:
Draft > Downgrade the compound. If it's a compound of compounds, you may be able to recreate the hierarchy using nested Part containers and successive Draft downgrades.

Another option may be to export from CadExchanger as .step, I think this may maintain the hierarchy.
"fight the good fight"
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: CAD Exchanger addon

Post by steve123 »

Somethings to maybe try:
Draft > Downgrade the compound. If it's a compound of compounds, you may be able to recreate the hierarchy using nested Part containers and successive Draft downgrades.
I haven't tried that. I will do so and see what happens.
Another option may be to export from CadExchanger as .step, I think this may maintain the hierarchy.
Using STEP as the intermediate file format works a bit better as you retain the hierarchy of the assembly. However, CAD Exchanger indicates a general error "One or more parts could not be imported." for which there is no indication what parts it is referring to. It is a rather complex assembly so tracking down which part(s) this message refers to is going to be a challenge.

Nevertheless, the STEP file can be imported :D. Each STEP object is a solid object without primitives.

I wonder if there will ever be a way to convert a CAD file from one format to another where the modelling is converted as well?

Or perhaps a feature/plugin that can take an arbitrary solid and create a FreeCAD part from the solid.
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: CAD Exchanger addon

Post by steve123 »

sgrogan wrote: Thu Feb 18, 2021 5:24 pm Somethings to maybe try:
Draft > Downgrade the compound. If it's a compound of compounds, you may be able to recreate the hierarchy using nested Part containers and successive Draft downgrades.
That kind of works. It generates a group of solid objects. The objects have auto generated names so you loose the relationships between the objects implied by the names and the hierarchy is lost too. There was a message in the report window:

Code: Select all

11:09:38  ----------------
11:09:38  GuiCommand: Downgrade
11:09:38  ----------------
11:09:38  Downgrade objects
11:09:38  Found 1 multi-solids compound: exploding it
11:09:46  ----------------
11:09:46  Downgrade objects
11:09:46  Found several objects: subtracting them from the first one
11:09:46  192.959 <App> Document.cpp(3429): Recursive calling of recompute for document topscnc_heavy_nema23
I performed an "undo" which reversed the a subtract and then all the solids appeared. Not sure why the subtract was there.


The STEP method generates much better results and the part structure appears to be retained.
Screen Shot 2021-02-18 at 11.18.03 AM.png
Screen Shot 2021-02-18 at 11.18.03 AM.png (734.99 KiB) Viewed 6470 times
I do not know if the original SolidWorks files contained the primitives that make up the various parts or not. It is possible the SolidWorks design I used was imported from a Fusion360 design.

Thank you for the feedback.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: CAD Exchanger addon

Post by sgrogan »

steve123 wrote: Thu Feb 18, 2021 6:05 pm I wonder if there will ever be a way to convert a CAD file from one format to another where the modelling is converted as well?

Or perhaps a feature/plugin that can take an arbitrary solid and create a FreeCAD part from the solid.
This would indeed be the holy grail.
SolidWorks has "Feature Recognition " my experience hasn't been very good. Maintaining parameticity and design intent is indeed a big challenge.

Solid Works uses a "Toolbox" that works like a standard parts library, hardware like screws and such. Even SW to SW doesn't always work if you don't have the proper Toolbox configured. I'd look at this for the missing imports in CadExchanger.

BTW: What version of CadExchanger are you using, I haven't tested this in quite some time.
"fight the good fight"
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: CAD Exchanger addon

Post by steve123 »

sgrogan wrote: Thu Feb 18, 2021 6:34 pm Solid Works uses a "Toolbox" that works like a standard parts library, hardware like screws and such. Even SW to SW doesn't always work if you don't have the proper Toolbox configured. I'd look at this for the missing imports in CadExchanger.

BTW: What version of CadExchanger are you using, I haven't tested this in quite some time.
Ahhh ... that is a good thought, I will start there.

CAD Exchanger is version 3.9.1. I have the thirty day evaluation license.
Screen Shot 2021-02-18 at 12.07.25 PM.png
Screen Shot 2021-02-18 at 12.07.25 PM.png (189.58 KiB) Viewed 6446 times
For anyone interested, the model in the illustration is the TopsCNC Heavy Nema23 open source CNC design. Here is a link:
https://createforcuriosity.com/en/desig ... 1o/details

As far an open source CNC goes, this machine looks pretty good.
JmL
Posts: 1
Joined: Fri Sep 17, 2021 3:13 pm

Re: CAD Exchanger addon

Post by JmL »

Hello, I'm having some trouble getting the CAD Exchanger addon to work with FreeCAD 0.19 under Ubuntu 20.04. Please see screenshot below, anything else I should be doing?

Image

Cheers,
JML
Syres
Veteran
Posts: 2891
Joined: Thu Aug 09, 2018 11:14 am

Re: CAD Exchanger addon

Post by Syres »

Have you read the Troubleshooting section https://github.com/yorikvanhavre/CADExc ... leshooting and therefore give feedback of any errors in the Report View to help narrow down the root cause?
XaviColl
Posts: 1
Joined: Tue Sep 28, 2021 3:12 pm

Re: CAD Exchanger addon

Post by XaviColl »

yorik wrote: Tue Jan 05, 2021 12:08 pm Thanks for all the docfixes Duncan!

BTW the CADExchanger addon has been updated to work with the latest (3.9.0) version of CADExchanger. There are many new file formats available, including DWG, which finally allows FreeCAD to handle 3D DWG files.
Good afternoon Yorik!
This thread it's really super interesting! I tested it, but it was impossible to import a simple drawing with 5 lines + 1 3Dface.

This is the scenario of test:
- Windows 10
- FreeCAD-0.19.2.7b5e18a-WIN-x64 (clean install)
- cadexchanger_3.10.0_build14619_win64, in trial period
- Everything configured as described in this thread (See image 01)
- Drawing used: a simple drawing with 5 lines + 1 3Dface (See image 02)
- Formats tested : DXF autocad 12 , DWG autocad 14 , DWG autocad 2000 , DWG autocad 2004 , DWG autocad 2007, DWG autocad 2010, DWG autocad 2013

Results aplying the workflows : FreeCAD -> Open / FreeCAD -> New -> Import
1- With the file "simple_Autocad12.dxf" -> Imported the 5 lines, but not the 3dface (See image 03)
2- With the file "simple_Autocad14.dwg" -> nothing is "opened" (See image 04)
3- I tryed to open the other dwg files, with the same result to the point 2

After several days of tests, I don't know how to solve it.......
any idea?

In this message, a attached a ZIP with the CAD files, and the images.
Thanks in advance!
Kind regards,
Xavier Coll
Attachments
CAD_files.zip
(181.64 KiB) Downloaded 73 times
01_FreeCAD+CadExchanger_CFG.png
01_FreeCAD+CadExchanger_CFG.png (46.26 KiB) Viewed 4559 times
02_Scenario.png
02_Scenario.png (81.56 KiB) Viewed 4559 times
03_Open_DXF_Autocad12.png
03_Open_DXF_Autocad12.png (98.78 KiB) Viewed 4559 times
04_Open_DWG_Autocad14.png
04_Open_DWG_Autocad14.png (146.14 KiB) Viewed 4559 times
Last edited by XaviColl on Tue Sep 28, 2021 5:48 pm, edited 2 times in total.
Post Reply