Skip to content

Issue #26343: CAM Tasks panel ignores selected Stock#26413

Merged
sliptonic merged 2 commits intoFreeCAD:mainfrom
MTronics:issue_#26343_CAM_relation_to_stock_gets_lost
Dec 23, 2025
Merged

Issue #26343: CAM Tasks panel ignores selected Stock#26413
sliptonic merged 2 commits intoFreeCAD:mainfrom
MTronics:issue_#26343_CAM_relation_to_stock_gets_lost

Conversation

@MTronics
Copy link
Contributor

@MTronics MTronics commented Dec 23, 2025

This is in reference to issue:
CAM: Relation to stock "from existing solid" gets lost #26343

The current code in \src\Mod\CAM\Path\Main\Gui\Job.py (line 719) ignores a specific stock selection within the Tasks panel Stock combobox. If for example a cloned stock object, e.g. a solid body, is selected, the selection defaults to the first item in the combolist, showing a wrong stock selection when leaving and reentering the Job -> Tasks -> Setup panel (Layout -> Stock).

2025-12-23 Issue #26343 - MTronic

The cause lies in comparing different strings to find a label match, one string object is generic (short name) while the other one has a suffix created during the clone process. See picture above, showing the combobox list item "RawMaterial" and the related "Stock-RawMaterial001" tree item. The strings never match, due to the suffix "...001", and the ridgid string comparison fails. I recommend using a partial (needle in haystack) string comparison.

The current code in \src\Mod\CAM\Path\Main\Gui\Job.py (line 719) ignores selected stock selections. In case of e.g. cloned stock objects it defaults to the first item in the combolist, showing a wrong stock selection.

The cause lies in comparing different strings to find a label match, but one string object is generic (short name) while the other one has a suffix created during the clone process. The strings never match and the ridgid string comparison fails. I recommend using a partial (needle in haystack) string comparison.
@github-actions github-actions bot added the Mod: CAM Related to the CAM Workbench label Dec 23, 2025
@sliptonic sliptonic enabled auto-merge December 23, 2025 14:51
@sliptonic sliptonic merged commit 2a6e3f8 into FreeCAD:main Dec 23, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from Queue to Done in Merge Queue Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mod: CAM Related to the CAM Workbench

Projects

Archived in project
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants