abaquspython建模_ABAQUS切削快速建模python程序

更新时间:2023-07-04 23:57:02 阅读: 评论:0

abaquspython建模_ABAQUS切削快速建模python程序
1 #-*- coding: mbcs -*-
2 #
3 #Abaqus/CAE Relea 6.14-
4 replay file
4 #Internal Version: 2015_06_12-04.41.13 135079
5 #Run by Administrator on Wed Apr 12 08:41:02 2017
6 #7
8 #from driverUtils import executeOnCaeGraphicsStartup
9 #executeOnCaeGraphicsStartup()
10 #: Executing "onCaeGraphicsStartup()" in the site directory ...
11 #: Abaqus Error:
12 #: This error may have occurred due to a change to the Abaqus Scripting
13 #: Interface. Plea e the Abaqus Scripting Manual for the details of
14 #: the changes. Also e the "Example environment files" ction of
15 #: the Abaqus Site Guide for up-to-date examples of common tasks in the
16 #: environment file.
blake lively
17 #: Execution of "onCaeGraphicsStartup()" in the site directory failed.
18 from abaqus import *
19 from abaqusConstants import *
20 ssion.Viewport(name='Viewport: 1', origin=(0.0, 0.0), width=414.662475585938,21 height=253.647216796875)22 ssion.viewports['Viewport: 1'].makeCurrent()23 ssion.viewports['Viewport: 1'].maximize()24 from caeModules import *
25 from driverUtils importexecuteOnCaeStartup26 executeOnCaeStartup()27 ssion.viewports['Viewport:
1'].ryOptions.tValues(28 referenceReprentation=ON)29 Mdb()30
31 #t the absoluteZero
dels['Model-1'].tValues(absoluteZero=-273)33
34 from math import *
35
36 #make the cutter dimension that you want
37 cutterLength = 0.5
38 cutterPointPos = cutterLength/2
39 rakeAngle = 8.0
40 clearanceAngle = 15.0
41
42
43 #: A new model databa has been created.
44 #: The model "Model-1" has been created.
45 ssion.viewports['Viewport: 1'].tValues(displayedObject=None)46 s = dels['Model-
1'].ConstrainedSketch(name='__profile__', sheetSize=cutterLength)47 g, v, d, c =s.geometry, s.vertices, s.dimensions,
point2=(cutterPointPos, -cutterPointPos))50 p = dels['Model-1'].Part(name='cutter', dimensionality=THREE_D,51 type=DISCRETE_RIGID_SURFACE)52 p = dels['Model-1'].parts['cutter']53 p.BaShellExtrude(sketch=s,
depth=cutterLength)54 s.untPrimaryObject()55
56 #make rake angle
57 p = dels['Model-1'].parts['cutter']58 f1, e1 =p.faces, p.edges59 t = p.MakeSketchTransform(sketchPlane=f1[2], sketchUpEdge=e1[8],60 sketchPlaneSide=SIDE1, sketchOrientation=TOP)61 s = dels['Model-
1'].ConstrainedSketch(name='__profile__', sheetSize=cutterLength**2,62 gridSpacing=cutterLength**2/50, transform=t)63 g, v, d, c =s.geometry, s.vertices, s.dimensions, s.constraints64 s.tPrimaryObject(option=SUPERIMPOSE)65 p =
划蝽科dels['Model-1'].parts['cutter']66 p.projectReferencesOntoSketch(sketch=s, filter=COPLANAR_EDGES)67
s.Line(point1=(cutterPointPos, -cutterPointPos), point2=(0, cutterPointPos))68 s.CoincidentConstraint(entity1=v[4],
entity2=g[4], addUndoState=Fal)69 s.Line(point1=(0, cutterPointPos), point2=(cutterPointPos, cutterPointPos))70
s.HorizontalConstraint(entity=g[9], addUndoState=Fal)71 s.Line(point1=(cutterPointPos, cutterPoigood skin
ntPos), point2= (cutterPointPos, -cutterPointPos))72 s.VerticalConstraint(entity=g[10], addUndoState=Fal)73
s.PerpendicularConstraint(entity1=g[9], entity2=g[10], addUndoState=Fal)74 s.AngularDimension(line1=g[3], line2=g[8], textPoint=(cutterPointPos - tan(rakeAngle*pi/180)*cutterPointPos/2,75 0.0), value=rakeAngle)76 p = dels['Model-1'].parts['cutter']77 f, e =p.faces, p.edges78 p.CutExtrude(sketchPlane=f[2], sketchUpEdge=e[8],
sketchPlaneSide=SIDE1,79 sketchOrientation=TOP, sketch=s, flipExtrudeDirection=ON)80 s.untPrimaryObject()81 dels['Model-1'].sketches['__profile__']82
83 #make clearance angle
84 p = dels['Model-1'].parts['cutter']85 f, e =p.faces, p.edges86 t = p.MakeSketchTransform(sketchPlane=f[0], sketchUpEdge=e[1],87 sketchPlaneSide=SIDE1, sketchOrientation=TOP, origin=(cutterPointPos, 0.0, cutterPointPos))88 s1 = dels['Model-1'].ConstrainedSketch(name='__profile__',89 sheetSize=cutterLength**2,
gridSpacing=cutterLength**2/50, transform=t)90 g, v, d, c =s1.geometry, s1.vertices, s1.dimensions, s1.constraints91
s1.tPrimaryObject(option=SUPERIMPOSE)92 p = dels['Model-1'].parts['cutter']93
p.projectReferencesOntoSketch(sketch=s1, filter=COPLANAR_EDGES)94 ssion.viewports['Viewport:
1'].tValues(displayedObject=p)95 s1.Line(point1=(cutterPointPos, -cutterPointPos), point2=(-cutterPointPos, 0))96
s1.CoincidentConstraint(entity1=v[4], entity2=g[4], addUndoState=Fal)97 s1.Line(point1=(-cutterPointPos, 0), point2=(-cutterPointPos, -cutterPointPos))98 s1.VerticalConstraint(entity=g[9], addUndoState=Fal)99 s1.Line(point1=(-cutterPointPos, -cutterPointPos), point2=(cutterPointPos, -cutterPointPos))100 s1.HorizontalConstraint(entity=g[10], addUndoState=Fal)101 s1.PerpendicularConstraint(entity1=g[9], entity2=g[10], addUndoState=Fal)102
s1.AngularDimension(line1=g[8], line2=g[5], textPoint=(0,103 -cutterPointPos +
tan(clearanceAngle*pi/180)*cutterPointPos/2), value=clearanceAngle)104 p = dels['Model-1'].parts['cutter']105 f1, e1 =p.faces, p.edges106 p.CutExtrude(sketchPlane=f1[0], sketchUpEdge=e1[1], sketchPlaneSide=SIDE1,107 sketchOrientation=TOP, sketch=s1, flipExtrudeDirection=ON)108 s1.untPrimaryObject()109 dels['Model-
1'].sketches['__profile__']110
111 #connect the parete faces
112 p = dels['Model-1'].parts['cutter']113 e =p.edges114 p.ShellLoft(loftctions=((e[0], ), (e[7], )),
startCondition=NONE,115 endCondition=NONE)116 p = dels['Model-1'].parts['cutter']117 e1 =p.edges118
p.ShellLoft(loftctions=((e1[4], ), (e1[11], )), startCondition=NONE,119 endCondition=NONE)120 p = dels['Model-1'].parts['cutter']121 e =p.edges122 p.ShellLoft(loftctions=((e[8], ), (e[11], )), startCondition=NONE,123
endCondition=NONE)124
125 #make the reference point
成衣制作
126 p = dels['Model-1'].parts['cutter']127 v1, e, d1, n =p.vertices, p.edges, p.datums, p.nodes128
p.ReferencePoint(point=p.InterestingPoint(edge=e[1], rule=MIDDLE))129
130
131 #t the reference point named cutter
132 p = dels['Model-1'].parts['cutter']133 r =p.referencePoints134 refPoints=(r[7], )135
p.Set(referencePoints=refPoints, name='cutter')136
137
138 #make the workpiece dimension that you want
139 workpieceLength = 0.2 #the length of the workpiece
140 workpieceHeight = 0.1 #the thickness of the workpiece
141 workpieceDepth = 0.1 #the width of the workpiece
142 workpiecePointPosX = workpieceLength/2
143 workpiecePointPosY = workpieceHeight/2
144 cutDepth = 0.01 #the equivalent thickness of the workpiece
145
146
147 #make the workpiece
148 s = dels['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=workpieceLength)149 g, v, d, c
=s.geometry, s.vertices, s.dimensions, s.constraints150 s.tPrimaryObject(option=STANDALONE)angle(point1= (-workpiecePointPosX, workpiecePointPosY), point2=(workpiecePointPosX, -workpiecePointPosY))152 p =
freezing
s.untPrimaryObject()157
158
159 #make the perate part
160 p = dels['Model-1'].parts['workpiece']161 f, e, d1 =p.faces, p.edges, p.datums162 t =
p.MakeSketchTransform(sketchPlane=f[4], sketchUpEdge=e[10],163 sketchPlaneSide=SIDE1, sketchOrientation=TOP)164 s = dels['Model-1'].ConstrainedSketch(name='__profile__',165 sheetSize=workpieceLength*2,
gridSpacing=workpieceLength*2/50, transform=t)166 g, v, d, c =s.geometry, s.vertices, s.dimensions, s.constraints167
s.tPrimaryObject(option=SUPERIMPOSE)168 p = dels['Model-1'].parts['workpiece']169
p.projectReferencesOntoSketch(sketch=s, filter=COPLANAR_EDGES)170 s.Line(point1=(-workpiecePointPosX, workpiecePointPosY), point2=(-workpiecePointPosX, workpiecePointPosY - cutDepth*2))171
s.VerticalConstraint(entity=g[6], addUndoState=Fal)172 s.ParallelConstraint(entity1=g[4], entity2=g[6],
addUndoState=Fal)173 s.CoincidentConstraint(entity1=v[4], entity2=g[4], addUndoState=Fal)174 s.Line(point1=(-workpiecePointPosX, workpiecePointPosY - cutDepth*2), point2=(workpiecePointPosX, workpiecePointPosY -
cutDepth*2))175 s.HorizontalConstraint(entity=g[7], addUndoState=Fal)176 s.PerpendicularConstraint(entity1=g[6], entity2=g[7], addUndoState=Fal)177 s.CoincidentConstraint(entity1=v[5], entity2=g[2], addUndoState=Fal)178
s.Line(point1=(workpiecePointPosX, workpiecePointPosY - cutDepth*2), point2=(workpiecePointPosX, workpiecePointPosY))179 s.VerticalConstraint(entity=g[8], addUndoState=Fal)180
s.PerpendicularConstraint(entity1=g[7], entity2=g[8], addUndoState=Fal)181 s.Line(point1=(workpiecePointPosX, workpiecePointPosY), point2=(-workpiecePointPosX, workpiecePointPosY))182 s.HorizontalConstraint(entity=g[9], addUndoState=Fal)183 s.PerpendicularConstraint(entity1=g[8], entity2=g[9], addUndoState=Fal)184 p =
sketchOrientation=TOP, sketch=s)190 s.untPrimaryObject()191 dels['Model-1'].sketches['__profile__']192 p = dels['Model-1'].parts['workpiece']193 c =p.cells194 pickedCells = c.getSequenceFromMask(mask=('[#1 ]', ), )195 e, d1 =p.edges, p.datums196 pickedEdges =(e[0], )197 p.PartitionCellByExtrudeEdge(line=e[7], cells=pickedCells,
edges=pickedEdges,198 n=REVERSE)199
200 #give the TC4 material to the workpiece
201 #create the material
blaine
202 from material importcreateMaterialFromDataString203 createMaterialFromDataString('Model-1', 'Ti6Al4V-Shenyang',
'6-14',204 """{205 'description': '',206 'inelasticHeatFraction': {'fraction': 0.9},207 'expansion': {'temperatureDependency': OFF, 'urSubroutine': OFF, 'zero': 0.0, 'dependencies': 0, 'table': ((9.1e-06,),), 'type': ISOTROPIC},208 'materialIdentifier':northward
'',209 'johnsonCookDamageInitiation': {'temperatureDependency': OFF, 'definition': MSFLD, 'direction': NMORI, 'fnt': 10.0,
'position': CENTROID, 'damageEvolution': {'temperatureDependency': OFF, 'dependencies': 0, 'softening': LINEAR, 'power': None, 'table': ((0.05,),), 'mixedModeBehavior': MODE_INDEPENDENT, 'type': DISPLACEMENT, 'modeMixRatio': ENERGY,
'degradation': MAXIMUM}, 'table': ((-0.09, 0.25, -0.5, 0.014, 3.87, 1650.0, 20.0, 1.0),), 'ks': 0.0, 'tolerance': 0.05,
'dependencies': 0, 'frequency': 1, 'feq': 10.0, 'alpha': 0.0, 'fnn': 10.0, 'omega': 1.0, 'numberImperfections': 4},210 'conductivity': {'temperatureDependency': ON, 'table': ((6.8, 20.0), (7.4, 100.0), (8.7, 200.0), (9.8, 300.0), (10.3, 400.0), (11.8, 500.0)),
'dependencies': 0, 'type': ISOTROPIC},211 'name': 'Ti6Al4V-Shenyang',212 'elastic': {'temperatureDependency': ON, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'dependencies': 0, 'table': ((109000.0, 0.34, 20.0), (97000.0, 0.34, 150.0), (91000.0, 0.34, 250.0), (85000.0, 0.34, 350.0), (75000.0, 0.34, 450.0)), 'type': ISOTROPIC},213 'density':
{'temperatureDependency': OFF, 'table': ((4.44e-09,),), 'dependencies': 0, 'fieldName': '', 'distributionType': UNIFORM},214
'plastic': {'temperatureDependency': OFF, 'strainRangeDependency': OFF, 'rate': OFF, 'dependencies': 0, 'hardening': JOHNSON_COOK, 'rateDependent': {'temperatureDependency': OFF, 'table': ((0.01, 1.0),), 'dependencies': 0, 'type':
JOHNSON_COOK}, 'dataType': HALF_CYCLE, 'table': ((875.0, 793.0, 0.386, 0.71, 1650.0, 20.0),), 'numBackstress': 1},215 'specificHeat': {'temperatureDependency': ON, 'table': ((611000000.0, 20.0), (624000000.0, 100.0), (653000000.0,
300.0), (674000000.0, 400.0), (691000000.0, 500.0), (703000000.0, 600.0)), 'dependencies': 0, 'law': CONSTANTVOLUME}216 }""")217 #: Material 'Ti6Al4V-Shenyang' has been copied to the current model.
218 #give the material to the ction
dels['Model-1'].HomogeneousSolidSection(name='TC4',220 material='Ti6Al4V-Shenyang', thickness=None)221 #give the ction to the model
222 p = dels['Model-1'].parts['workpiece']223 c =p.cells224 cells = c.getSequenceFromMask(mask=('[#3 ]', ), )225 region = regionToolt.Region(cells=cells)226 p = dels['Model-1'].parts['workpiece']227
p.SectionAssignment(region=region, ctionName='TC4', offt=0.0,228 offtType=MIDDLE_SURFACE, offtField='',229 thicknessAssignment=FROM_SECTION)230
231 #the size of the cutting region
232 sizeOfCutting = 0.05
233 numOfNoneCutting = 4
234
235
236 #mesh the workpiece
系统设计说明书237 p = dels['Model-1'].parts['workpiece']238 e =p.edges239 pickedEdges = e.getSequenceFromMask(mask=
('[#c2025 ]', ), )240 #p.edEdgeByNumber(edges=pickedEdges, number=int(workpieceLength/sizeOfCutting),
constraint=FINER)
241 p.edEdgeByNumber(edges=pickedEdges, number=, constraint=FINER)242 p = dels['Model-
1'].parts['workpiece']243 e =p.edges244 pickedEdges = e.getSequenceFromMask(mask=('[#2890a ]', ), )245
#p.edEdgeByNumber(edges=pickedEdges, number=int(workpieceDepth/sizeOfCutting), constraint=FINER)
246 p.edEdgeByNumber(edges=pickedEdges, number=20, constraint=FINER)247 p = dels['Model-
划船英语
1'].parts['workpiece']248 p = dels['Model-1'].parts['workpiece']249 e =p.edges250 pickedEdges =
number=int(cutDepth*2/sizeOfCutting)*2, constraint=FINER)
252 p.edEdgeByNumber(edges=pickedEdges, number=10, constraint=FINER)253 p = dels['Model-
1'].parts['workpiece']254 e =p.edges255 pickedEdges = e.getSequenceFromMask(mask=('[#1450 ]', ), )256
p.edEdgeByNumber(edges=pickedEdges, number=numOfNoneCutting, constraint=FINER)257
258 #assign mesh type
259 elemType1 = mesh.ElemType(elemCode=C3D8T, elemLibrary=EXPLICIT,260 condOrderAccuracy=OFF, distortionControl=DEFAULT, elemDeletion=ON)261 elemType2 = mesh.ElemType(elemCode=C3D6T,
elemLibrary=EXPLICIT)262 elemType3 = mesh.ElemType(elemCode=C3D4T, elemLibrary=EXPLICIT)263 p =
elemType3))269 p = dels['Model-1'].parts['workpiece']ateMesh()271
272 #creat mesh part
273 p = dels['Model-1'].parts['workpiece']274 p.PartFromMesh(name='workpiece-mesh-1', copySets=True)275
276
277 #the size of the mesh cutter
278 sizeOfCutter = 0.01
279 #mesh the cutter
280 p = dels['Model-1'].parts['cutter']281 p.edPart(size=sizeOfCutter, deviationFactor=0.1,
minSizeFactor=0.1)282 p = dels['Model-1'].parts['cutter']ateMesh()284
285
286 #asmble the parts
287 #first asmble the workpiece
288 a = dels['Model-1'].rootAsmbly289 a.DatumCsysByDefault(CARTESIAN)290 p = dels['Model-
1'].parts['workpiece-mesh-1']291 a.Instance(name='workpiece-mesh-1-1', part=p, dependent=ON)292 a =
craftsmanship

本文发布于:2023-07-04 23:57:02,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1078825.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:建模   切削   说明书   成衣   设计   制作   系统   程序
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图