code: def show_cationpi(self):
          
          grp = self.getPseudoBondGroup("Cation-Pi-%i" % self.tid, associateWith=[self.model])
          grp.lineWidth = 3
          grp.lineType = self.chimera.Dash
          for i, cat in enumerate(self.plcomplex.pication):
  
              m = self.model
              r = m.newResidue("pseudoatoms", " ", 1, " ")
              chargecenter = m.newAtom("CHARGE", self.chimera.Element("CHARGE"))
              x, y, z = cat.charge_center
              chargecenter.setCoord(self.chimera.Coord(x, y, z))
              r.addAtom(chargecenter)
  
              centroid = m.newAtom("CENTROID", self.chimera.Element("CENTROID"))
              x, y, z = cat.ring_center
              centroid.setCoord(self.chimera.Coord(x, y, z))
              r.addAtom(centroid)
  
              b = grp.newPseudoBond(centroid, chargecenter)
              b.color = self.colorbyname('orange')
  
              if cat.protcharged:
                  self.bs_res_ids += cat.charge_atoms
              else:
                  self.bs_res_ids += cat.ring_atoms
docs: Visualizes cation-pi interactions