×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Cutting geometry issues

Cutting geometry issues

Cutting geometry issues

(OP)
Hi,

I'm trying to make multiple Boolean cuts from the same part.

The issue I am having is that Abaqus insists on creating a new part for every cut I make, which is making scripting this a nightmare.

My latest attempt is the following,

CODE --> Python

def createAndCutSphere(diameter, centroid, sph):
    
    # Create sphere 
    rootSphere = 'rootSphere'   # Original sphere that is to be cut
    newRoot = 'newRootSphere'   # New root instance created by cut operation
    sphName = 'Sphere'          # Sphere that is to be removed from root sphere
    radius = diameter/2.0
    mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=100.0)
    mdb.models['Model-1'].sketches['__profile__'].ConstructionLine(point1=(0.0, -50.0), point2=(0.0, 50.0))
    mdb.models['Model-1'].sketches['__profile__'].FixedConstraint(entity=mdb.models['Model-1'].sketches['__profile__'].geometry[2])
    mdb.models['Model-1'].sketches['__profile__'].Line(point1=(0.0, radius), point2=(0.0, -radius))
    mdb.models['Model-1'].sketches['__profile__'].VerticalConstraint(addUndoState=False, entity=mdb.models['Model-1'].sketches['__profile__'].geometry[3])
    mdb.models['Model-1'].sketches['__profile__'].ParallelConstraint(addUndoState=False, entity1=mdb.models['Model-1'].sketches['__profile__'].geometry[2], entity2=mdb.models['Model-1'].sketches['__profile__'].geometry[3])
    mdb.models['Model-1'].sketches['__profile__'].CoincidentConstraint(addUndoState=False, entity1=mdb.models['Model-1'].sketches['__profile__'].vertices[0], entity2=mdb.models['Model-1'].sketches['__profile__'].geometry[2])
    mdb.models['Model-1'].sketches['__profile__'].CoincidentConstraint(addUndoState=False, entity1=mdb.models['Model-1'].sketches['__profile__'].vertices[1], entity2=mdb.models['Model-1'].sketches['__profile__'].geometry[2])
    mdb.models['Model-1'].sketches['__profile__'].ArcByCenterEnds(center=(0.0, 0.0), direction=CLOCKWISE, point1=(0.0, radius), point2=(0.0, -radius))
    mdb.models['Model-1'].sketches['__profile__'].CoincidentConstraint(addUndoState=False, entity1=mdb.models['Model-1'].sketches['__profile__'].vertices[2], entity2=mdb.models['Model-1'].sketches['__profile__'].geometry[3])
    mdb.models['Model-1'].sketches['__profile__'].EqualDistanceConstraint(addUndoState=False, entity1=mdb.models['Model-1'].sketches['__profile__'].vertices[0], entity2=mdb.models['Model-1'].sketches['__profile__'].vertices[1], midpoint=mdb.models['Model-1'].sketches['__profile__'].vertices[2])
    mdb.models['Model-1'].Part(dimensionality=THREE_D, name=sphName, type=DEFORMABLE_BODY)
    mdb.models['Model-1'].parts[sphName].BaseSolidRevolve(angle=360.0, flipRevolveDirection=OFF, sketch=mdb.models['Model-1'].sketches['__profile__'])
    
    # Place sphere to be cut    
    mdb.models['Model-1'].rootAssembly.Instance(dependent=ON, name=sphName, part=mdb.models['Model-1'].parts[sphName])
    xTrans = centroid[0]
    yTrans = centroid[1]
    zTrans = centroid[2]
    mdb.models['Model-1'].rootAssembly.translate(instanceList=(sphName, ), vector=(xTrans, yTrans, zTrans))
    
    # Cut operation
    mdb.models['Model-1'].rootAssembly.InstanceFromBooleanCut(cuttingInstances=(mdb.models['Model-1'].rootAssembly.instances[sphName], ), instanceToBeCut=mdb.models['Model-1'].rootAssembly.instances[rootSphere], name=newRoot, originalInstances=DELETE)

    # Delete unwanted parts
    del mdb.models['Model-1'].parts[sphName]
    del mdb.models['Model-1'].parts[rootSphere]

    # Rename root sphere instance
    mdb.models['Model-1'].parts.changeKey(fromName=newRoot, toName=rootSphere)
    mdb.models['Model-1'].rootAssembly.regenerate() 

This works exactly once! Then it stops with, KeyError: rootSphere, even though this instance is showing up in the assembly instance list.

I have been going around in circles with this. I have tried all sorts of renaming schemes but always Abaqus doesnt recognize the instances.

Any help as always much appreciated before I have to resort to destroying Abaqus for disobedience.

RE: Cutting geometry issues

(OP)
No takers on this?

RE: Cutting geometry issues

Hello,
Would it be possible to cut "all cells in bounding box" with datum planes? By searching for everything within a box, maybe you don't have to care about the names that are created.

I haven't tried it myself. :/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources