Skip to content

Instantly share code, notes, and snippets.

@Erhannis
Created November 7, 2025 04:11
Show Gist options
  • Save Erhannis/88573e6d4112eed7db6f54ebf22fab03 to your computer and use it in GitHub Desktop.
Save Erhannis/88573e6d4112eed7db6f54ebf22fab03 to your computer and use it in GitHub Desktop.
In FreeCAD, click a face, then run the macro, to select the edges of that face
s = Gui.Selection.getSelectionEx()[0]
f = s.SubObjects[0]
edgeOfFace=f.Edges
edgeAll=s.Object.Shape.Edges
edges=[]
for i in edgeOfFace:
for j in enumerate(edgeAll):
if j[1].isSame(i):
name = "Edge%d" % (j[0]+1)
edges.append(name)
Gui.Selection.clearSelection()
Gui.Selection.addSelection(s.Object, edges)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment