Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Jan 9, 2019
Messages
82
Location
US
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
 
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]
 
Thank you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top