Adil Memet
Mechanical
- Mar 12, 2023
- 37

Hello, Dear Friends
I am new to this site and I found it useful discussion about problems we all are dealing with. I have a question about some advice about how to select cell with python script, in which, I created first "Step" then in correspondingly it has to select element from mesh element shown in the picture. basically, first "step" is created then in the interaction model or option, it has to select first cell for activation or deactivation , for the second "step ", it has to select cell number 2 for activation or deactivation and so on. my question is how to write to loop so that it can select one single cell element make interaction. Thank in advance.
Python script:
from part import *
from material import *
from section import *
from assembly import *
from step import *
from interaction import *
from load import *
from mesh import *
from optimization import *
from job import *
from sketch import *
from visualization import *
from connectorBehavior import *
Tol=0.000000001
Speed=0.01
##Pass1
for i in range(2,196) :
mdb.models['Job-1'].HeatTransferStep(deltmx=500,initialInc=0.05,maxInc=0.2,
maxNumInc=1000000,minInc=1e-11,name='Welding-'+str(i),previous='Welding-'+str(i-1))
##activation
for i in range(1,195):
mdb.models['Job-1'].ModelChange(activeInStep=True, createStepName='Welding-'+str(i),
includeStrain=False,name='Welding-'+str(i),region=Region(elements=mdb.models['Job-1'].rootAssembly.instances['Part-1-1'].elements.getByBoundingBox(
-Tol+Speed*(i-1),-(0.0075+Tol),-(0.005+Tol),Tol+Speed*i,0.0075+Tol,Tol)), regionType=ELEMENTS)