News:

SMF - Just Installed!

Main Menu

keyError abaqus/python

Started by guest6, September 21, 2016, 06:19:47 PM

Previous topic - Next topic

guest6

why i have this error ?
keyError : wire-2  ( if p.features
  • .id in id_list:) abaqus/python
    the python script is :


    from abaqus import *
    from abaqusConstants import *


    vpName = session.currentViewportName
    modelName = session.sessionState[vpName]['modelName']

    m = mdb.models[modelName]
    p = m.parts['Part-1']


    id_list = []


    # check all datum for type and location if type contains string Point
    # if location fits certain criteria (z>5, e.g.) add datum ID into list

    for x in p.datums.keys():
        t = str(type(p.datums
  • ))
        if t.find('Point')>0:
            coords = p.datums
  • .pointOn
            if coords[2]>5:
                id_list.append(x)

    #print id_list


    # check all features and deletes features with a ID that is in list

    for x in p.features.keys():
        if p.features
  • .id in id_list:
            del p.features