Zitat:
Original erstellt von Mustaine:
I've run your script and it throws several error unrelated to your question. First the name of a function is not matching, then the number of arguments doesn't fit. I've fixed both, but then a problem with a variable and it's namespace appeared.Maybe you create a simple example that focuses on the question.
I simplified it a bit. No I have a rectangular part with a rectangular inclusion.
My function "MakeSet" should make a set of both rectangles.
Problem: The function only makes a set of one of the two rectangles.
When I change the range(0,2) to range(1,2), it makes a set of the larger rectangle without the inclusion.
The final aim is to build a function which makes a set of round inclusions (~50 of them) in a rectangle.
def MakeSet(circleList):
p = mdb.models['Model-1'].parts['Part-1']
f = p.faces
list_x = (1,-1,0)
list_y = (1,-1,0)
coordinates_for_faces = tuple()
tuple_coordinates = tuple()
for i in range(0,2):
tuple_coordinates = ((list_x[i], list_y[i], 0.0),)
coordinates_for_faces = coordinates_for_faces + tuple_coordinates
print("coordinates_for_faces", coordinates_for_faces)
faces = f.findAt(coordinates_for_faces)
p.Set(faces=faces, name='SetOfFibers')
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP