Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###########################################################
- # select one edge on a solid- preferably one that lies in a horizontal plane
- # the rest of the script will deterimine which wire it is part of
- # and highlight the rest of the edges in that wire
- ###########################################################
- import FreeCAD
- import FreeCADGui as Gui
- import Part
- sel=Gui.Selection.getSelectionEx()[0].SubObjects
- obj=Gui.Selection.getSelection()[0]
- edge = sel[0]
- goodface = None
- for f in obj.Shape.Faces:
- if (f.BoundBox.ZMax==f.BoundBox.ZMin) and (f.BoundBox.ZMax==edge.BoundBox.ZMax):
- goodface = f
- wire=None
- for w in goodface.Wires:
- for e in w.Edges:
- if e.isSame(edge):
- print 'found a match'
- wire=w
- # now we know which wire we are dealing with
- # time to match edge names with it
- eidx = 1
- elindex =[]
- for e in obj.Shape.Edges:
- for ew in wire.Edges:
- if e.isSame(ew):
- elindex.append(eidx)
- eidx+=1
- # now highlight the appropriate edges:
- edlist = []
- for i in elindex:
- edlist.append('Edge'+str(i))
- Gui.Selection.addSelection(App.ActiveDocument.Fillet, ('Edge'+str(i)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement