s8utt
Mechanical
- Oct 13, 2022
- 1
I have a 3D deformed model that I need to create a display group based on the elements that intersect the Z plane at 0.
If i run this script on an opened simulation
The resulting ODB shows only the Z slice at position 0.
Now manually I can choose
> Create Display Group
Item > Elements
Method > Pick from viewport
Drag a box over the 'slice' and it will select all the elements that intersect the slice.
> Click replace ( So only all the elements I have selected are shown in the model )
> Deactivate the view cut.
I am left with only the elements that intersect the Z at position 0.
Is there a way to automate this with a script ?
If i run this script on an opened simulation
Python:
from abaqus import *
from caeModules import *
from abaqusConstants import *
import displayGroupOdbToolset as dgo
vp = session.viewports[session.currentViewportName]
odbName = vp.displayedObject.name
odb = session.odbs[odbName]
leaf = dgo.LeafFromElementSets(elementSets=('PRODUCT',))
vp.odbDisplay.displayGroup.replace(leaf=leaf)
vp.odbDisplay.display.setValues(plotState=(
CONTOURS_ON_DEF, ))
vp.odbDisplay.setValues(viewCutNames=('Z-Plane',), viewCut=ON)
vp.odbDisplay.viewCuts['Z-Plane'].setValues(position=0, showModelBelowCut=False, showModelAboveCut=False)
The resulting ODB shows only the Z slice at position 0.
Now manually I can choose
> Create Display Group
Item > Elements
Method > Pick from viewport
Drag a box over the 'slice' and it will select all the elements that intersect the slice.
> Click replace ( So only all the elements I have selected are shown in the model )
> Deactivate the view cut.
I am left with only the elements that intersect the Z at position 0.
Is there a way to automate this with a script ?