Preparing a code to do a parametric analysis. When I do the modelling in abaqus cae, while creating datum/reference axis/point, it uses a datum number. When I further copy and paste that code through "run script", I always end up with KeyError. Any suggestions/references to work with datum plane, datum axis in scripting.
Tyring to prepare a script to perform parametric modelling. For that, I used datum plane, and axis in the modelling. abaqus used datum[] to define the selected entities. However, if I rerun the code, it ended uup with KeyError. It also happened with the number inside the brackets of edges, faces, and datum. The below code is working, as it has simple geoemtry. When I work with multiple parts, the number inside the bracket of datums are varying. So, if i change the dimension of the part in script, it ends in Keyerror.
Is there any way to include the datum references, edge references in a code by our own.
from part import *
from sketch import *
mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=200.0)
mdb.models['Model-1'].sketches['__profile__'].CircleByCenterPerimeter(center=(
0.0, 0.0), point1=(1.0, 0.0))
mdb.models['Model-1'].Part(dimensionality=THREE_D, name='Part-1', type=
DEFORMABLE_BODY)
mdb.models['Model-1'].parts['Part-1'].BaseSolidExtrude(depth=10.0, sketch=
mdb.models['Model-1'].sketches['__profile__'])
del mdb.models['Model-1'].sketches['__profile__']
mdb.models['Model-1'].parts['Part-1'].DatumPlaneByPrincipalPlane(offset=-5.0,
principalPlane=YZPLANE)
mdb.models['Model-1'].parts['Part-1'].DatumAxisByPrincipalAxis(principalAxis=
YAXIS)
mdb.models['Model-1'].ConstrainedSketch(gridSpacing=0.95, name='__profile__',
sheetSize=38.2, transform=
mdb.models['Model-1'].parts['Part-1'].MakeSketchTransform(
sketchPlane=mdb.models['Model-1'].parts['Part-1'].datums[2],
sketchPlaneSide=SIDE1,
sketchUpEdge=mdb.models['Model-1'].parts['Part-1'].datums[3],
sketchOrientation=RIGHT, origin=(-5.0, 0.0, 0.0)))
mdb.models['Model-1'].parts['Part-1'].projectReferencesOntoSketch(filter=
COPLANAR_EDGES, sketch=mdb.models['Model-1'].sketches['__profile__'])
mdb.models['Model-1'].sketches['__profile__'].CircleByCenterPerimeter(center=(
0.0, 0.0), point1=(2.0, 0.0))
mdb.models['Model-1'].sketches['__profile__'].move(objectList=(
mdb.models['Model-1'].sketches['__profile__'].geometry[3], ), vector=(0.0,
5.0))
mdb.models['Model-1'].parts['Part-1'].SolidExtrude(depth=2.0,
flipExtrudeDirection=ON, sketch=
mdb.models['Model-1'].sketches['__profile__'], sketchOrientation=RIGHT,
sketchPlane=mdb.models['Model-1'].parts['Part-1'].datums[2], sketchUpEdge=
mdb.models['Model-1'].parts['Part-1'].datums[3])