Selecting faces on bodies for named selections #2439
ianwhenham-bit
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write a script to select faces for a named selection, but am struggling with the syntax for selecting faces.
It seems to be of the format:
for face in body.Faces:
but 'body' is not defined. How do I 'define' solid bodies in the geometry so they can be searched for faces that match my criteria?
I looked at the NACA airfoil example to try to reverse understand the naming syntax, which has:
for face in fluid_faces:
Where fluid_faces is defined with a previous line:
fluid_faces = fluid.faces
Then as far as I can tell the object 'fluid' is created from the extrude command:
fluid = design.extrude_sketch("Fluid", fluid_sketch, BOX_WIDTH)
If that's the case is 'fluid' just the name of the solid in the feature tree?
Suppose I have a solid in the feature tree called ACC, how do I use the 'for' command to examine face on that solid body?
I think it's something like
for face in ACC.Faces:
But that doesn't work, with the message ACC is not defined. It seems I somehow need to assign the body to a variable?
Thanks,
Ian
Beta Was this translation helpful? Give feedback.
All reactions