falviani wrote: ↑Sun Aug 07, 2022 2:37 pm
... is there any other way to add to the operation's base geometry from python?
Again, thanks,
Frank
Evening.
Sure. Use the `FreeCADGui` module in scripts, or reference the `Gui` module in the python console. The example below is used directly in the python console, so `Gui` and `App` are already available. `Shape` is the actual name of a Part object that exists in my file, not to be confused with the `Shape` attribute of Part, Draft, and PartDesign objects, like `Box.Shape` or `Body.Pad.Shape` that contain the actual shape attributes and methods.
Code: Select all
import FreeCAD as App # Unnecessary in python console
import FreeCADGui as Gui # Unnecessary in python console
obj = App.ActiveDocument.Shape # Shape is the actual name of my Part object
Gui.Selection.addSelection(obj, ["Face5", "Edge20"])
The above code will add `Face5` and `Edge20` of my `Shape` object to the current Gui selection. They will be highlighted and visible in the viewport just as manually selected features.
Have a great night.
Russell