'NoneType' object has no attribute 'id'

pgaire
Posts: 10
Joined: Wed Feb 09, 2022 11:31 pm

'NoneType' object has no attribute 'id'

Post by pgaire » Wed Feb 09, 2022 11:39 pm

I am trying to do an eigenanalysis of a building, when I run the analysis, I get the 'NoneType' object has no attribute 'id' error. Can anyone suggest me a way that I can solve this issue?

Thank you.
Image
Attachments
error.png
error.png (31.58 KiB) Viewed 1438 times

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: 'NoneType' object has no attribute 'id'

Post by STKO Team » Thu Feb 10, 2022 8:48 am

If you look at the last line of the traceback, it is trying to get the "id" attribute from the "phys_prop" object, which is "NoneType". In python it means it is a null object.

What happens is that at some edge with a forceBeamColumn element property, you don't have any physical property

pgaire
Posts: 10
Joined: Wed Feb 09, 2022 11:31 pm

Re: 'NoneType' object has no attribute 'id'

Post by pgaire » Sun Feb 13, 2022 9:48 pm

Works now. Thank you

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: 'NoneType' object has no attribute 'id'

Post by STKO Team » Mon Feb 14, 2022 8:45 am

you're welcome

DaHuang
Posts: 7
Joined: Mon Jun 06, 2022 10:12 pm

Re: 'NoneType' object has no attribute 'id'

Post by DaHuang » Thu Jun 23, 2022 5:04 am

STKO Team wrote:
Thu Feb 10, 2022 8:48 am
If you look at the last line of the traceback, it is trying to get the "id" attribute from the "phys_prop" object, which is "NoneType". In python it means it is a null object.

What happens is that at some edge with a forceBeamColumn element property, you don't have any physical property
Hi STKO team, I have similar issue, how do you know which element does not have physical property? I have checked many times.

M Ilyas
Posts: 2
Joined: Thu Jun 23, 2022 12:47 pm

Re: 'NoneType' object has no attribute 'id'

Post by M Ilyas » Thu Jun 23, 2022 12:50 pm

Hi I have the same problem. Kindly advise...

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: 'NoneType' object has no attribute 'id'

Post by STKO Team » Fri Jun 24, 2022 9:31 am

You have to look at the last line of the traceback of the error.
It will tell you what element is missing a physical property

DaHuang
Posts: 7
Joined: Mon Jun 06, 2022 10:12 pm

Re: 'NoneType' object has no attribute 'id'

Post by DaHuang » Fri Jun 24, 2022 5:32 pm

STKO Team wrote:
Fri Jun 24, 2022 9:31 am
You have to look at the last line of the traceback of the error.
It will tell you what element is missing a physical property
Dear SKTO team, the last line of the traceback of the error shows lines in the python file, not the element number? I attached my traceback, It looks like something is wrong with the elastic-beam-column members, but I even deleted them and assigned properties again, and still does not work and the traceback is the same. thoughts?

Thanks!
Attachments
traceback.png
traceback.png (121.63 KiB) Viewed 1117 times

STKO Team
Posts: 1346
Joined: Tue Oct 29, 2019 8:45 am

Re: 'NoneType' object has no attribute 'id'

Post by STKO Team » Mon Jun 27, 2022 10:01 am

exactly, it is saying that at least one edge with the elasticBeamColumn element element property does not have any physical property.

namePh = phys_prop.XObject.Xnamespace
NoneType (in this case "phys_prop") does not have the XObject attribute. In fact it is None, which in python means "Nothing", i.e. no physical property assigned.

malcomjarr
Posts: 1
Joined: Mon Aug 08, 2022 6:17 am

Re: 'NoneType' object has no attribute 'id'

Post by malcomjarr » Mon Aug 08, 2022 6:18 am

AttributeError means that there was an Error that had to do with an Attribute request. In general, when you write x.y, y is the purported attribute of x. NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None. That usually means that an assignment or function call up failed or returned an unexpected result.

Code: Select all

mylist = mylist.sort()
The sort() method of a Python list sorts the list in-place, that is, mylist is modified. But the actual return value of the method is None and not the list sorted. So you've just assigned None to mylist. If you next try to do, say, mylist.append(1) Python will give you this error.

Post Reply