Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Python Error

Status
Not open for further replies.

mj345

Mechanical
Jan 9, 2019
76
Hello All,

Thank you all for your time and help.
When I am extracting part names from Part dictionary and getting this error.

ERROR: 'Part' object has no attribute 'keys'

Can anyone share how to resolve it. Any help is appreciated.

Thanks
 
Replies continue below

Recommended for you

Can you paste the part of your Python code that is supposed to do this ?
 
Thanks FEA way,
I was able to resolve the above mentioned error.
But had difficulty in getting all the parts name from the model.
My goal here is to list all the parts names.
Please see the script below and error while executing it.

TypeError: 'Part' object does not support item assignment

Any help is appreciated.

########################################################################################
######Applying Material and section Properties to the parts####################
########################################################################################
from abaqus import *
from abaqusConstants import *
import regionToolset

vps = session.viewports.values()[0]
x = vps.displayedObject.modelName
m=mdb.models[x]

parts_list =[]
for i in range(25):
p =mdb.models[x].parts.keys()[0]
parts_list.append (i)
 
[pre]vps = session.viewports[session.currentViewportName]
x = vps.displayedObject.modelName # assuming assembly
m=mdb.models[x]
parts_list = m.parts.keys()[/pre]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor