Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

How to use python actor in BCVTB

asked 2017-06-12 05:50:48 -0500

niharkopal's avatar

updated 2017-06-12 10:13:52 -0500

Hi, I was trying to learn how to use python actor in BCVTB. So I tried to take two constants ( x and y ), pass them as variables to python actor, add them using python script and plot a graph which should be a constant line. The python script that I have below gives me a TypeError. I can't seem to understand why '+' is not being recognised as an operand. I am also attaching the screenshots of individual actors and the system xml file. Can you please tell me where my problem lies ? My python script looks like:

class Main :
  def fire(self) :

    if not self.input.hasToken(0) :
      return
    t = self.input.get(0)
    x = self.cons2.get(0)
    y = int(t) + int(x)
    self.output.broadcast(t)

But this gives me a TypeError.

C:\fakepath\plotter.PNG

C:\fakepath\pythonactor.PNG

C:\fakepath\pythonports.PNG

C:\fakepath\systemxmlpage.PNG

edit retag flag offensive close merge delete

Comments

What's self.cons2?

Julien Marrec's avatar Julien Marrec  ( 2017-06-12 10:20:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-06-20 10:10:28 -0500

This has been discussed and answered here

https://groups.google.com/forum/#!topic/bcvtb/N2RhjNb-Cbo

Please just post on one forum.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

2 followers

Stats

Asked: 2017-06-12 05:50:48 -0500

Seen: 806 times

Last updated: Jun 20 '17