Changing selected faces in a pad/pocket operation

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!
kisolre
Veteran
Posts: 4162
Joined: Wed Nov 21, 2018 1:13 pm

Re: Changing selected faces in a pad/pocket operation

Post by kisolre »

wavexx wrote: Fri Jul 23, 2021 8:03 am Is it possible to change the face selection at all in an existing pocket operation?
Not directly with an editor. I imagine that selecting part of Fillet/Chamfer tool could be utilized for that but somebody has to program it first :)

For now it works by hand editing the Profile property of Pad/Pocket. You show the parent feature and select the desired new face. Note its name (e.g. Face23). Now show the Pad/Pocket operation. Select its Profile property and invoke the editor by pressing the three dot button. You will see the tree and the feature selected with its subelement (e.g. Face12) in the column next to it. Write the new face name (Face23) there. Note that selecting the row to edit the cell will actually deselect it and you need to click the row again to select it (turns a little darker blue) to select it again before closing the dialog. Recompute the file.
cadcam
Posts: 273
Joined: Thu Apr 02, 2020 10:39 am

Re: Changing selected faces in a pad/pocket operation

Post by cadcam »

@wavexx
During design at some point I want to change which faces of my solid are pocketed (let's say I want to remove one existing face and pocket only one). How do I do that?
I may have missunderstood what you are trying to do, but have you tried selecting the associated sketch and then used the 'attachement editor'?


Regards
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Changing selected faces in a pad/pocket operation

Post by chrisb »

In the case discussed here, there is no associated sketch.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Changing selected faces in a pad/pocket operation

Post by chrisb »

kisolre wrote: Sat Jul 24, 2021 6:29 am Write the new face name (Face23) there.
Thanks for this procedure. I had also played with the three-button dialog, but didn't notice that the column with the faces could be edited.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Changing selected faces in a pad/pocket operation

Post by TheMarkster »

In this model I have begun with a rectangle padded to 10mm.
Next step a sketch with 4 circles is pocketed to a depth of 2mm.
3rd step is I selected one of the faces (top right = face13) and pocketed through all.

I experimented with changing face13 to face12 or face14 (top left or bottom left [in this model) in the gui, but it failed. To do this click the profile property, then the [...] button to bring up the editor. Double click face13 and manually enter face12. This should work, but it fails.

So, I did it in the python console.

Code: Select all

"App.ActiveDocument.Pocket001.Profile=(App.ActiveDocument.Pocket,"Face12")
Note: the Profile property requires a python tuple, which is 2 values inside parentheses, such as (a,b). The first is the document object, in this case App.ActiveDocument.Pocket. The second parameter is the string name of the face to use, in this case "Face12"

attachment=0]Snip macro screenshot-edbaff.png[/attachment]

To figure out which face to use you need to make visible the feature containing the face, in this case "Pocket". Click pocket in the tree and press spacebar. This makes it visible and hides pocket001 temporarily. Then click the desired face and look in the python console to see its name (or look at the status bar while hovering on the face in preselection mode).

Edit: include full version information

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.25306 (Git)
Build type: Release
Branch: master
Hash: 5f5b3d9b67136edda1f6738f1a83154990f7839d
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
Attachments
change_faces.FCStd
(21.44 KiB) Downloaded 19 times
Snip macro screenshot-edbaff.png
Snip macro screenshot-edbaff.png (109.17 KiB) Viewed 693 times
kisolre
Veteran
Posts: 4162
Joined: Wed Nov 21, 2018 1:13 pm

Re: Changing selected faces in a pad/pocket operation

Post by kisolre »

TheMarkster wrote: Sat Jul 24, 2021 6:32 pm I experimented with changing face13 to face12 or face14 (top left or bottom left [in this model) in the gui, but it failed. To do this click the profile property, then the [...] button to bring up the editor. Double click face13 and manually enter face12. This should work, but it fails.
Did you click on the Pocket line in the dialog after the edit to make it active BEFORE confirming? The first doubleclick allows for text editing but actually deactivates the line and it needs to be activated again. I just tried and it works perfectly fine with the model you posted.

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.25237 (Git)
Build type: Release
Branch: master
Hash: 3307bfe07c9024eb9e681bd13582323ed363f757
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Bulgarian/Bulgaria (bg_BG)
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Changing selected faces in a pad/pocket operation

Post by TheMarkster »

kisolre wrote: Sun Jul 25, 2021 7:43 pm
Did you click on the Pocket line in the dialog after the edit to make it active BEFORE confirming? The first doubleclick allows for text editing but actually deactivates the line and it needs to be activated again. I just tried and it works perfectly fine with the model you posted.

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.25237 (Git)
Build type: Release
Branch: master
Hash: 3307bfe07c9024eb9e681bd13582323ed363f757
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Bulgarian/Bulgaria (bg_BG)
That was the trick. Thanks.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Changing selected faces in a pad/pocket operation

Post by chrisb »

Interesting, that it doesn't change the selected item on macOS.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply