How can we automatically assign thickness values defined in a csv file to surfaces in Spaceclaim?
Below is a sample code that does that. It is assuming that the pre-existing csv file (file called mythick.csv in D drive) has one column with the surface names in Spaceclaim and one with their thicknesses.
Note: for the below to work we need to have insert selection set to index.
# Python Script, API Version = V22
with open('D:\mythick.csv', 'rb') as f:
reader = csv.reader(f)
for row in reader:
allBodies = GetRootPart().GetAllBodies()
for name in names:
for body in allBodies:
result = Midsurface.Convert(BodySelection.Create(body), MM(float(th[i])))