Page 1 of 1

Need some coding help, macro included

Posted: Mon May 23, 2022 4:44 am
by freedman
The goal is to select an edge and the macro will highlight the associated face. I made a simple macro so if a Body object is selected in the tree it will exit, simple enough. Start the macro and select an edge.

I am attaching a file but it is just a cylinder.

I'm having a problem here:

Code: Select all

for fac in faces:
	if fac.Surface.isPlanar():
        	print("Found planar face",fac)
                Gui.Selection.addSelection(self.doc.Name,'Body',fac) 


I can't figure out what AddSelection needs to work correctly.
Thank you

Re: Need some coding help, macro included

Posted: Mon May 23, 2022 3:51 pm
by freedman
Got it. I'm close, now I need to use edwilliams code to select which face to use.