If I select an edge or a vertex, how to get the face from it?
thx a lot.
get the face of a edge
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
get the face of a edge
Last edited by Vincent B on Sat Jun 12, 2021 8:59 pm, edited 1 time in total.
Re: get the face of a edge
I assume you have access to the main shape.
Select the edge of an object and try :
Select the edge of an object and try :
Code: Select all
sel = Gui.Selection.getSelectionEx()[0]
edge = sel.SubObjects[0]
shape = sel.Object.Shape
faces = shape.ancestorsOfType(edge, Part.Face)
print(faces)
Re: get the face of a edge
one time again, thx a lot!