Get size of this bpatcher?


    May 10 2014 | 4:45 pm
    If you have an abstraction being displayed in a bpatcher, is it possible for the abstraction to get the size of the bpatcher?

    • May 14 2014 | 9:50 am
      Hi, not sure how to do this in normal Max, but the following js will give you the bpatcher size if called from within:
      inlets = 1 outlets = 1
      function getsize() { if ( this.patcher.box ) outlet( 0, this.patcher.box.rect ); }
    • May 14 2014 | 10:09 am
      Amazing, thanks Lee.
      I will call this code on patcher load, to resize the bpatcher contents based on the size of the bpatcher.
      Is there a way to have this code execute automatically after each time the bpatcher is resized?
    • May 14 2014 | 10:47 am
      No, don't think so - if you need to get updated, best thing to do is set up a metro object to fire the message into the js every x ms and respond to changes in the result