# vtkSimpleBondPerceiver in python

**URL:** https://discourse.vtk.org/t/vtksimplebondperceiver-in-python/334
**Category:** Support
**Created:** [February 26, 2019, 3:02pm UTC](https://discourse.vtk.org/t/vtksimplebondperceiver-in-python/334 "2019-02-26T15:02:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jellby](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jellby/32/135_2.png) [@Jellby](https://discourse.vtk.org/u/Jellby)
#### Post date: [February 26, 2019, 3:02pm UTC](https://discourse.vtk.org/t/vtksimplebondperceiver-in-python/334/1 "2019-02-26T15:02:26Z")

</div>

I’m trying to use vtkSimpleBondPerceiver in python (python 2.7, vtk 8.1.2, PyQt4 4.10.4). I can define it, but I can’t (or I don’t know how to) use it:

```
mol = vtk.vtkMolecule()
for i in mydata: # mydata is a dictionary with 'Z' and 'xyz' keys
  mol.AppendAtom(i['Z'], *i['xyz'])
print(mol)
bp = vtk.vtkSimpleBondPerceiver()
bp.ComputeBonds(mol)

```

and I get:

```
AttributeError: 'vtkDomainsChemistryPython.vtkSimpleBondPerceiver' object has no attribute 'ComputeBonds'

```

Am I missing something, doing something wrong, or is this just not implemented/wrapped in python?

---

<div class="post-metadata">

### Author: ![allison.vacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allison.vacanti/32/679_2.png) [@allison.vacanti](https://discourse.vtk.org/u/allison.vacanti)
#### Post date: [February 26, 2019, 11:25pm UTC](https://discourse.vtk.org/t/vtksimplebondperceiver-in-python/334/2 "2019-02-26T23:25:32Z")

</div>

`vtkSimpleBondPerceiver` is meant to be used in a pipeline like the other VTK filters. For standalone usage, something like the following should work:

```auto
mol = vtk.vtkMolecule()
for i in mydata: # mydata is a dictionary with 'Z' and 'xyz' keys
  mol.AppendAtom(i['Z'], *i['xyz'])
print(mol)
bp = vtk.vtkSimpleBondPerceiver()
bp.SetInputData(mol)
bp.Update()
molWithBonds = bp.GetOutput()

```

---

<div class="post-metadata">

### Author: ![Jellby](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jellby/32/135_2.png) [@Jellby](https://discourse.vtk.org/u/Jellby)
#### Post date: [February 27, 2019, 1:53pm UTC](https://discourse.vtk.org/t/vtksimplebondperceiver-in-python/334/3 "2019-02-27T13:53:40Z")

</div>

Thank you. You can tell I’m still a noob 🙂
