May 6, 2021 at 6:00 pm

atulsingh92

Subscriber

This is what I could come up with for the image above. The 4 small circles have 8mm dia and the big one has 15mm dia.

So the logic was for all the faces in that body, if Circled shape geoemtry has area < 4mm dia and area 15mm dia, then create the group

options = PowerSelectOptions(True)

inmanifold =GetRootPart().Bodies[1].Faces

for face in inmanifold:

outpatches = NamedSelection.Create(Selection.Create(face), Selection())

if isinstance(face.Shape.Geometry, Circle) and face.Shape.Area <= math.pi * 0.004* 0.004 and face.Shape.Area > math.pi*0.015*0.015*0.25:

outpatches.CreatedNamedSelection.SetName(face)

else:

pass

However, the above, basically generates Group1 to Group11 for 11 faces that I have in the manifold, and not the only 4 groups that I need for small circles.

1) Is the applied logic correct?

2) How can I change the number of my required circle in SetName, properly, such that face 2, 7, 10, and 11 becomes out1 out2 out3 and out4? (Printing "face" returned nothing that I could change, perhaps it is a different data type)

3) What is a good source to learn about V17 api?

So the logic was for all the faces in that body, if Circled shape geoemtry has area < 4mm dia and area 15mm dia, then create the group

options = PowerSelectOptions(True)

inmanifold =GetRootPart().Bodies[1].Faces

for face in inmanifold:

outpatches = NamedSelection.Create(Selection.Create(face), Selection())

if isinstance(face.Shape.Geometry, Circle) and face.Shape.Area <= math.pi * 0.004* 0.004 and face.Shape.Area > math.pi*0.015*0.015*0.25:

outpatches.CreatedNamedSelection.SetName(face)

else:

pass

However, the above, basically generates Group1 to Group11 for 11 faces that I have in the manifold, and not the only 4 groups that I need for small circles.

1) Is the applied logic correct?

2) How can I change the number of my required circle in SetName, properly, such that face 2, 7, 10, and 11 becomes out1 out2 out3 and out4? (Printing "face" returned nothing that I could change, perhaps it is a different data type)

3) What is a good source to learn about V17 api?