Guilherme Simonato
Automotive
- Jun 26, 2019
- 3
Hello everyone,
I have 900 parts to meshing on Abaqus 2018. I need a help to write python script to meshing all parts with conditions.
The parts between the number 1 to 200 are a similar geometry, so I will use the same condition like global size, curvature control, size control and type of elements.
The parts between the number 201 to 400 are similar geometry too.
If help something I used macro recording to take this script (only mesh the part number 1)...
# -*- coding: mbcs -*-
# Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
import __main__
def Meshing():
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
c = p.cells
pickedRegions = c.getSequenceFromMask(mask=('[#3 ]', ), )
p.setMeshControls(regions=pickedRegions, technique=SWEEP)
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
p.seedPart(size=5.0, deviationFactor=0.1, minSizeFactor=0.1)
elemType1 = mesh.ElemType(elemCode=C3D8HS, elemLibrary=STANDARD)
elemType2 = mesh.ElemType(elemCode=C3D6, elemLibrary=STANDARD)
elemType3 = mesh.ElemType(elemCode=C3D4, elemLibrary=STANDARD)
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
c = p.cells
cells = c.getSequenceFromMask(mask=('[#3 ]', ), )
pickedRegions =(cells, )
p.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2,
elemType3))
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
p.generateMesh()
How can a create a automatic script loop to meshing all parts?
I do not know how to use a loop or a loop with interval.
I am new on python script programing.
Many thanks!
I have 900 parts to meshing on Abaqus 2018. I need a help to write python script to meshing all parts with conditions.
The parts between the number 1 to 200 are a similar geometry, so I will use the same condition like global size, curvature control, size control and type of elements.
The parts between the number 201 to 400 are similar geometry too.
If help something I used macro recording to take this script (only mesh the part number 1)...
# -*- coding: mbcs -*-
# Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
import __main__
def Meshing():
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step
import interaction
import load
import mesh
import optimization
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
c = p.cells
pickedRegions = c.getSequenceFromMask(mask=('[#3 ]', ), )
p.setMeshControls(regions=pickedRegions, technique=SWEEP)
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
p.seedPart(size=5.0, deviationFactor=0.1, minSizeFactor=0.1)
elemType1 = mesh.ElemType(elemCode=C3D8HS, elemLibrary=STANDARD)
elemType2 = mesh.ElemType(elemCode=C3D6, elemLibrary=STANDARD)
elemType3 = mesh.ElemType(elemCode=C3D4, elemLibrary=STANDARD)
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
c = p.cells
cells = c.getSequenceFromMask(mask=('[#3 ]', ), )
pickedRegions =(cells, )
p.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2,
elemType3))
p = mdb.models['Model-1'].parts['Autoclave Trolley-1']
p.generateMesh()
How can a create a automatic script loop to meshing all parts?
I do not know how to use a loop or a loop with interval.
I am new on python script programing.
Many thanks!