Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 AttributeError: 'NoneType' object has no attribute 'label' : What's wrong ?
Hello everyone,

I'm not able to solve my pb by myself, so let me explain what it is.

I'd like to automate the calculation with Abaqus. So I begin by creating and writing a script in python and finally I execute this file on Abaqus
At the step of my work, I'd like to load a step file on abaqus and not my previous model.cae. But by trying to do this, an error appeared on the following part of my python's file.

a = mdb.models['Verzahnung'].rootAssembly
n1 = a.instances['ZR1_instance'].nodes
koor_load = (-2.637359,29.302616,3.6)
nodes1 = n1.getClosest(coordinates=(koor_load ,))
nodelabel = nodes1[0].label     <<<----------------------------- THIS LINE
meshnode = n1.sequenceFromLabels((nodelabel,))
a.Set(nodes=meshnode , name='Set-2')
ERROR TYPE: AttributeError: 'NoneType' object has no attribute 'label'

Just in case, here is the previous code to load the model:

mdb = openMdb(r"Model_Stirnrad.cae")
And the current code:

mdb.models.changeKey(fromName='Model-1', toName='Verzahnung')
step = mdb.openStep('Model1.stp', scaleFromFile=OFF)
mdb.models['Verzahnung'].PartFromGeometryFile(name='ZR_1_K', geometryFile=step, combine=False, dimensionality=THREE_D, type=DEFORMABLE_BODY)
p = mdb.models['Verzahnung'].parts['ZR_1_K']
a = mdb.models['Verzahnung'].rootAssembly
a.Instance(name='ZR1_instance', part=p, dependent=ON)
Hope this is clear :D
And thanks to those who are enough courageous to read my pb and solve it :)
Have a nice WE.
Verzeihung, it is not clear. From the code it seems n1.getClosest is a class. And this class is expected to have a method or an attribute called label. But it appears not to have such.
It is even questionable whether "n1.getClosest" is a class because the message says: " 'NoneType' object".
So you should search how "n1.getClosest" is defined.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  'tuple' object has no attribute 'data' gregpederseng 2 189 Feb-25-2020, 08:01 PM
Last Post: gregpederseng
  AttributeError: type object 'FunctionNode' has no attribute '_TestValidateFuncLabel__ binhduonggttn 0 130 Feb-19-2020, 11:29 AM
Last Post: binhduonggttn
  AttributeError: 'Register' object has no attribute 'bit_7' colt 1 244 Dec-12-2019, 09:39 PM
Last Post: micseydel
  TypeError: 'NoneType' object is not subscriptable Jmekubo 5 17,319 Nov-07-2019, 03:59 AM
Last Post: markfilan
  python gives wrong string length and wrong character thienson30 2 282 Oct-15-2019, 08:54 PM
Last Post: Gribouillis
  Object cannot find its attribute colt 6 535 Oct-09-2019, 12:30 AM
Last Post: ichabod801
  AttributeError: 'top_block_sptr' object has no attribute 'change_param_1' Hadad 2 375 Oct-01-2019, 06:33 PM
Last Post: Hadad
  'Client' object has no attribute 'send_message Bambob01 1 958 Sep-27-2019, 01:40 AM
Last Post: Bambob01
  Reading DBF files from Amazon s3 throwing error - 'int' object has no attribute 'isa abeesm 1 334 Sep-22-2019, 05:49 PM
Last Post: ndc85430
  AttributeError: module 'asyncio' has no attribute 'get_event_loop Susmitha 5 9,162 Sep-03-2019, 02:33 AM
Last Post: chengonghao

Forum Jump:

Users browsing this thread: 1 Guest(s)