As the recovery of the face on which the Feature is attached is done with the instruction :
Code: Select all
FreeCADGui.Selection.getSelectionEx()
Code: Select all
FreeCADGui.Selection.getSelectionEx()
It's not only about what feature is referenced; it's also a specific warning that you are referencing the feature from outside the Body, and are thus losing the placement and coordinate system information of the body (for your link). That is because every Body has a single GeoFeatureGroup, which modifies the coordinate system of each feature inside the Body according to this GeoFeatureGroup. If you link a feature inside a Body to somewhere outside the Body, you lose this GeoFeatureGroup coordinate transformation, hence the warning.user1234 wrote: ↑Fri Mar 17, 2023 12:14 am It is only a warning. You reference elements (face, lines, vertex) from features (in that case probably Pocket001), not the whole Body, outside the Body. This means when you add a feature to the Body (for example a fillet), it will not be considered. It still references to the not last visible feature.
In practice you should use instead the most parent object derived from the selection:Cuq wrote: ↑Fri Mar 17, 2023 1:07 am Ok thanks for these answers.
As the recovery of the face on which the Feature is attached is done with the instruction :
How to recover the corresponding reference from the function to the body ? And is it really necessar, knowing that if the surfaces are modified at the end there is a strong chance that the reference on the body is also invalid?Code: Select all
FreeCADGui.Selection.getSelectionEx()
Code: Select all
FreeCADGui.Selection.getSelectionEx("", 0)
In practice the problem with :aapo wrote: ↑Fri Mar 17, 2023 4:34 pm In practice you should use instead the most parent object derived from the selection:
Please see the screenshot below and note the difference, using the first variant with 0 would give you the Body object and get rid of the warning, I think.Code: Select all
FreeCADGui.Selection.getSelectionEx("", 0)
20230317 getSelectionEx-pic01.png
Code: Select all
FreeCADGui.Selection.getSelectionEx("", 0)