CADlalala
Aerospace
- Apr 3, 2014
- 43
Dear all,
My question is how to programmatically relate the edges of a single shell face and the faces of the model generated when the shell is revolved.
Also I would like to know how to relate the faces of the resultant revolve and the result obtained when the revolve is intersected with another random body (e.g. a cylinder). So to summarise I have:
a) A shell face
b) The revolve of the shell face
c) The intersection of b) with a cylinder
And I want to relate:
• a) with b) and b) with c)
There is a picture attached and my code to generate the models is below.
Thank you!
from abaqus import *
from abaqusConstants import *
model=mdb.models['Model-1']
assy=model.rootAssembly
assy.DatumCsysByDefault(CARTESIAN)
#-----------------TARGET----------------------------------------
s = mdb.models['Model-1'].ConstrainedSketch(name='__cube__',sheetSize=2000.0)
s.ConstructionLine(point1=(0.0,0.0), point2=(1.0, 0.0))
s.Line(point1=(0, 0), point2=(1500, 0))
s.Line(point1=(1500, 0), point2=(1500, 1500))
s.Line(point1=(1500, 1500), point2=(0, 1500))
s.Line(point1=(0,1500), point2=(0, 0))
#Create Shell
p = model.Part(name='cube', dimensionality=THREE_D,type=DEFORMABLE_BODY)
p = model.parts['cube']
p.BaseSolidExtrude(sketch=s, depth=500.0)
del model.sketches['__cube__']
#-----------------POLY0----------------------------------------
s0 = model.ConstrainedSketch(name='__poly0__',sheetSize=2000.0)
s0.ConstructionLine(point1=(0.0,0.0), point2=(1.0, 0.0))
s0.Line(point1=(914.1, 554.1), point2=(914.1, 579.2))
s0.Line(point1=(914.1, 579.2), point2=(928.8, 579.2))
s0.Line(point1=(928.8, 579.2), point2=(928.8, 554.1))
s0.Line(point1=(928.8, 554.1), point2=(914.1, 554.1))
#Create Shell
p0 = model.Part(name='Part-0', dimensionality=THREE_D,type=DEFORMABLE_BODY)
p0 = model.parts['Part-0']
p0.BaseShell(sketch=s0)
#Create SOR
pr0 = model.Part(name='Part-0-r', dimensionality=THREE_D,type=DEFORMABLE_BODY)
pr0 = model.parts['Part-0-r']
pr0.BaseSolidRevolve(angle=360.0, flipRevolveDirection=ON, sketch=s0)
del model.sketches['__poly0__']
#------------------BOOLEAN----------------------------------------
assy.DatumCsysByDefault(CARTESIAN)
assy.Instance(dependent=ON, name='Part-0-r-1', part= mdb.models['Model-1'].parts['Part-0-r'])
assy.Instance(dependent=ON, name='cube-1', part= mdb.models['Model-1'].parts['cube'])
cut0=assy.InstanceFromBooleanCut(cuttingInstances=(
assy.instances['cube-1'], ), instanceToBeCut=
assy.instances['Part-0-r-1'], name='Part-0-r-Inter',
originalInstances=SUPPRESS)
My question is how to programmatically relate the edges of a single shell face and the faces of the model generated when the shell is revolved.
Also I would like to know how to relate the faces of the resultant revolve and the result obtained when the revolve is intersected with another random body (e.g. a cylinder). So to summarise I have:
a) A shell face
b) The revolve of the shell face
c) The intersection of b) with a cylinder
And I want to relate:
• a) with b) and b) with c)
There is a picture attached and my code to generate the models is below.
Thank you!
from abaqus import *
from abaqusConstants import *
model=mdb.models['Model-1']
assy=model.rootAssembly
assy.DatumCsysByDefault(CARTESIAN)
#-----------------TARGET----------------------------------------
s = mdb.models['Model-1'].ConstrainedSketch(name='__cube__',sheetSize=2000.0)
s.ConstructionLine(point1=(0.0,0.0), point2=(1.0, 0.0))
s.Line(point1=(0, 0), point2=(1500, 0))
s.Line(point1=(1500, 0), point2=(1500, 1500))
s.Line(point1=(1500, 1500), point2=(0, 1500))
s.Line(point1=(0,1500), point2=(0, 0))
#Create Shell
p = model.Part(name='cube', dimensionality=THREE_D,type=DEFORMABLE_BODY)
p = model.parts['cube']
p.BaseSolidExtrude(sketch=s, depth=500.0)
del model.sketches['__cube__']
#-----------------POLY0----------------------------------------
s0 = model.ConstrainedSketch(name='__poly0__',sheetSize=2000.0)
s0.ConstructionLine(point1=(0.0,0.0), point2=(1.0, 0.0))
s0.Line(point1=(914.1, 554.1), point2=(914.1, 579.2))
s0.Line(point1=(914.1, 579.2), point2=(928.8, 579.2))
s0.Line(point1=(928.8, 579.2), point2=(928.8, 554.1))
s0.Line(point1=(928.8, 554.1), point2=(914.1, 554.1))
#Create Shell
p0 = model.Part(name='Part-0', dimensionality=THREE_D,type=DEFORMABLE_BODY)
p0 = model.parts['Part-0']
p0.BaseShell(sketch=s0)
#Create SOR
pr0 = model.Part(name='Part-0-r', dimensionality=THREE_D,type=DEFORMABLE_BODY)
pr0 = model.parts['Part-0-r']
pr0.BaseSolidRevolve(angle=360.0, flipRevolveDirection=ON, sketch=s0)
del model.sketches['__poly0__']
#------------------BOOLEAN----------------------------------------
assy.DatumCsysByDefault(CARTESIAN)
assy.Instance(dependent=ON, name='Part-0-r-1', part= mdb.models['Model-1'].parts['Part-0-r'])
assy.Instance(dependent=ON, name='cube-1', part= mdb.models['Model-1'].parts['cube'])
cut0=assy.InstanceFromBooleanCut(cuttingInstances=(
assy.instances['cube-1'], ), instanceToBeCut=
assy.instances['Part-0-r-1'], name='Part-0-r-Inter',
originalInstances=SUPPRESS)