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

How to use python actor in BCVTB

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

niharkopal gravatar image

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

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) :
    t = self.input.get(0)
    x = self.cons2.get(0)
    y = int(t) + int(x)

But this gives me a TypeError.





edit retag flag offensive close merge delete


What's self.cons2?

Julien Marrec gravatar image Julien Marrec  ( 2017-06-12 10:20:59 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

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

This has been discussed and answered here!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


Question Tools



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

Seen: 673 times

Last updated: Jun 20 '17