Creating a surface with a sketch using Abaqus Python -
my question might sounds rather simple knowledge in abaqus scripting inexistent. aim represent set of polygons in same part each polygon represents 2d surface (in 3d space) of part. creating script generate sketch each polygon (not sure if best approach). creating surface foreach of sketches.
how achieve this?
many thanks!
the code:
from abaqus import * abaqusconstants import * import sketch import part mymodel=mdb.model(name='model-1') #-------------first polygon------------------------------- s1=mymodel.constrainedsketch(name='__poly0__', sheetsize=100) g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints s1.line(point1=(10.0, 10.0), point2=(10.0, 15.0)) s1.line(point1=(10.0, 15.0), point2=(-10.0, 15.0)) s1.line(point1=(-10.0, 15.0), point2=(-10.0, -15.0)) s1.line(point1=(-10.0, -15.0), point2=(10.0, -15.0)) s1.line(point1=(10.0, -15.0), point2=(10.0, -10.0)) s1.line(point1=(10.0, -10.0), point2=(5, 0)) s1.line(point1=(5, 0), point2=(10.0, 10.0)) #-------------second polygon------------------------------- s2=mymodel.constrainedsketch(name='__poly1__', sheetsize=100) g, v, d, c = s2.geometry, s2.vertices, s2.dimensions, s2.constraints s2.line(point1=(10.0, 10.0), point2=(5, 0)) s2.line(point1=(5, 0), point2=(10.0, -10.0)) s2.line(point1=(10.0, -10.0), point2=(10.0, -15.0)) s2.line(point1=(10.0, -15.0), point2=(15.0, -15.0)) s2.line(point1=(15.0, -15.0), point2=(15.0, 0.0)) s2.line(point1=(15.0, 0.0), point2=(10, 10)) #----------one part 2 planar faces (one per polygon)----- p = mdb.models['model-1'].part(name='part-1', dimensionality=three_d,type=deformable_body) p = mdb.models['model-1'].parts['part-1'] #how can put 2 planar faces here? #first polygon #p.baseshell(sketch=s1) #del mdb.models['model-1'].sketches['__poly0__'] #second polygon #p.baseshell(sketch=s2) #del mdb.models['model-1'].sketches['__poly1__'] #-------------------------------------------------------------
surface can mean 2 things. in abaqus terminology surface reference face or edge of part or assembly. doesn't mean flat part. out side of abaqus, creating surface taken mean creating planar part.
here code yours makes part in 3d space (a 2d part have edges in sense of abaqus surfaces). creates abaqus surface on 1 of 2 faces.
from abaqus import * abaqusconstants import * s1 = mdb.models['model-1'].constrainedsketch(name='__profile__',sheetsize=200.0) g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints s1.line(point1=(-21.25, 22.5), point2=(-33.75, -20.0)) s1.line(point1=(-33.75, -20.0), point2=(-3.75, -32.5)) s1.line(point1=(-3.75, -32.5), point2=(40.0, -25.0)) s1.line(point1=(40.0, -25.0), point2=(25.0, 25.0)) s1.line(point1=(25.0, 25.0), point2=(-21.25, 22.5)) #this creates actual part - planar surface exists in 3d space p = mdb.models['model-1'].part(name='part-2', dimensionality=three_d,type=deformable_body) p = mdb.models['model-1'].parts['part-2'] p.baseshell(sketch=s1) del mdb.models['model-1'].sketches['__profile__'] #the following finds , creates "surface" on part. f = p.faces face=f.findat(coordinates=(0.0,0.0,0.0)) face_ind=face.index side1faces=f[face_ind:face_ind+1] p.surface(side1faces=side1faces, name='surf-1')
if isn't question asked, please explain more in question.
Comments
Post a Comment