python - How to create a multiple part in a same model in abaqus using abaqus script -


from part import * material import * section import * assembly import * step import * interaction import * load import * mesh import * optimization import * job import * sketch import * visualization import * connectorbehavior import * import numpy np math import sqrt  fd =open('circle_input.txt','r') d=np.loadtxt(fd,delimiter=',',dtype={'names':('co1','col2','col3'),'formats':('float','float','float')}) in range(0,len(d),1):      description = 'as particles: '# + 'x = ' + str(x) + ' y = ' + str(y) + ' z = ' + str(z)     model = 'model'      print description     print model     mdb.model(modeltype=standard_explicit, name=model, description=description)      j in range(i+1,len(d)):      ## sketch square         mdb.models[model].constrainedsketch(name='__profile__', sheetsize=200.0)         mdb.models[model].sketches['__profile__'].circlebycenterperimeter(center=(d[i][0], d[i][1]), point1=(0.0, d[i][2]))                     mdb.models[model].part(dimensionality=two_d_planar, name='part-1', type=deformable_body)         mdb.models[model].parts['part-1'].baseshell(sketch=mdb.models[model].sketches['__profile__'])         del mdb.models[model].sketches['__profile__'] 

i trying draw multiple circles in same model imported text file. each row specifies geometric information precisely circle center , radius.

the following code wrote sketching 1 circle

any appreciated

thanks

i think need create part outside of loop. code has not been tested.

from part import * material import * section import * assembly import * step import * interaction import * load import * mesh import * optimization import * job import * sketch import * visualization import * connectorbehavior import * import numpy np math import sqrt  fd =open('circle_input.txt','r') d=np.loadtxt(fd,delimiter=',',dtype={'names':('co1','col2','col3'),'formats':('float','float','float')}) in range(0,len(d),1):      description = 'as particles: '# + 'x = ' + str(x) + ' y = ' + str(y) + ' z = ' + str(z)     model = 'model'      print description     print model     model = mdb.model(modeltype=standard_explicit, name=model, description=description)     sketch = model.constrainedsketch(name='__profile__', sheetsize=200.0)     part = model.part(dimensionality=two_d_planar, name='part-1', type=deformable_body)        j in range(i+1,len(d)):      ## sketch square                     sketch.circlebycenterperimeter(center=(d[i][0], d[i][1]), point1=(0.0, d[i][2]))                  part.baseshell(sketch=sketch)     del model.sketches['__profile__'] 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -