Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading material properties using Python?

Status
Not open for further replies.

DrBwts

Mechanical
Nov 4, 2012
297
OK my code so far...

Python:
mats=mdb.models['Job-15'].materials

for key in mats.keys():
    myElas=mdb.models['Job-15'].materials[key].elastic
    print myElas

My output...

({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((451.736, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})
({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((57532.1, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})
({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((69890.5, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})
({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((82248.9, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})
({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((94607.3, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})
({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((106966.0, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})
({'dependencies': 0, 'moduli': LONG_TERM, 'noCompression': OFF, 'noTension': OFF, 'table': ((119324.0, 0.3),), 'temperatureDependency': OFF, 'type': ISOTROPIC})

What I would like to do is to be able access just the contents of 'table' but the 'Elastic' objects aren't behaving like a dictionary or a tuple with a dictionary in it.

Any thoughts?
 
Replies continue below

Recommended for you

When you access the table then you'll get the properties as tuple.

Code:
mats=mdb.models['Model-1'].materials
for key in mats.keys():
    myElas=mats[key].elastic.table
    print myElas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor