Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CAM import for stable FreeCAD release #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andredunford
Copy link

@andredunford andredunford commented Jan 22, 2025

Issue:

In stable FC 1.0.0, Add Tracks fails when creating some footprint geometries with the error:

module 'CAM' has no attribute 'Area'

This appears to happen because the new stable version reverted the Path workbench name back to CAM; possibly for backward compatibility.

FC-0 20 FC-1 0 0
Left: v0.20 'Path' workbench. Right: v1.0.0 renamed back to 'CAM' workbench.

A previous try/except statement patch (996e609) tried to accommodate various builds using the older CAM module, however this now fails in the stable release.

Resolution:

Reverse the order of the import try statement. Ensure that the first attempt to load refers to the more up-to-date Path module, and falls back to the older CAM module only if the Path module is not found.

This has been tested on the current stable version FC-1.0.0 and and older version FC-0.20.

@BraidenPsiuk
Copy link
Contributor

Hi, I'm the one who was trying to support other builds 👋 interesting that they changed it back.
I just tested your patch in the RealThunder branch, it seems to load properly there, so hopefully this should be good to go! Thanks for helping to ensure it works across multiple FreeCAD builds 😄

@andredunford
Copy link
Author

andredunford commented Jan 22, 2025

Hi Braiden, thanks for testing with the RealThunder branch; glad to hear it's working there as well. Your fix made sense, but this just prioritizes the Path module, which, I believe, superseded CAM in previous releases.

After digging into the 1.0.0 source a bit, CAM appears to have been brought back, and Path was made a sub-module of it. The import order becomes relevant because there are now references to both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants