×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Reading material properties using Python?

Reading material properties using Python?

Reading material properties using Python?

(OP)
OK my code so far...

CODE --> Python

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

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

My output...

Quote:

({'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?

RE: Reading material properties using Python?

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 

RE: Reading material properties using Python?

(OP)
Success thankyou!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources