Forum Navigation
You need to log in to create posts and topics.

object has no attribute 'topology' error

hi all

I try to use scripts in document in my pdb file . and I use this script:

from import *

from import *

pipeline = import_file('C:/Users/neginpardaz/Desktop/runpc/packmol/ecbox.pdb')

data = pipeline.compute()

for a,b in data.particles.bonds.topology:

print("Bond from particle %i to particle %i" % (a,b))


and I got the error :

File "<string>", line 6, in <module>

AttributeError: 'NoneType' object has no attribute 'topology'

that means the object bonds has not attribute 'topology'

how can I resolve the problem??




OVITO's PDB file reader only creates a BondsObject in case your PDB file contains at least one CONECT record. Otherwise you will have to use the CreateBondsModifier first, to generate the BondsObject within the ParticlesObject.

If you like you can send us your file to have a look at it.