Issue #26343: CAM Tasks panel ignores selected Stock#26413
Merged
sliptonic merged 2 commits intoFreeCAD:mainfrom Dec 23, 2025
Merged
Issue #26343: CAM Tasks panel ignores selected Stock#26413sliptonic merged 2 commits intoFreeCAD:mainfrom
sliptonic merged 2 commits intoFreeCAD:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
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.