select 0d, 1d, 2d, 3d parts

here’s how to select parts based on element type

 

Here is a link to a python file

select_parts_0D_1D_2D.py

from ensight.objs import *

#
#
#
def echo_part_elem_type(p):
    if p.HAS1DELEMENTS:
        print p.DESCRIPTION, " has 1D line elements"
    if p.HAS2DELEMENTS:
        print p.DESCRIPTION, " has 2D surface elements"
    if p.HAS3DELEMENTS:
        print p.DESCRIPTION, " has 3D volume elements"
    #  Ensight 10 only
    #if p.HAS0DELEMENTS:
    #    print p.DESCRIPTION, " has 0D point elements"
    #
    # STRUCTURED MODEL PART
    #
    if p.PARTTYPE == ensight.PART_MODEL:
        if p.NODERANGESTEPI[0] > 0 and p.NODERANGESTEPI[1] > 0 and p.NODERANGESTEPI[2] > 0:
            print "Structured I from ", p.NODERANGESTEPI[0] , " to ", p.NODERANGESTEPI[1], " by step " , p.NODERANGESTEPI[2]
        if p.NODERANGESTEPJ[0] > 0 and p.NODERANGESTEPJ[1] > 0 and p.NODERANGESTEPJ[2] > 0:
            print "Structured J from ", p.NODERANGESTEPJ[0] , " to ", p.NODERANGESTEPJ[1], " by step " , p.NODERANGESTEPJ[2]
        if p.NODERANGESTEPK[0] > 0 and p.NODERANGESTEPK[1] > 0 and p.NODERANGESTEPK[2] > 0:
            print "Structured K from ", p.NODERANGESTEPK[0] , " to ", p.NODERANGESTEPK[1], " by step " , p.NODERANGESTEPK[2]
    print
    return
#
#  Note this methodology will work in ES10
#
for p in core.PARTS:
    if p.ISGROUP == True:
        if p.sources:
            for subp in p.sources:
                echo_part_elem_type(subp)
    else:
        echo_part_elem_type(p)