Gregi Posted November 21, 2020 Share Posted November 21, 2020 Hello everybody I would like to create a "dynamic" Popup Node, which uses Content of a Worksheet. It works pretty good, but its not refreshing the Popup-List in the OIP, but the output content is the correct one. So i guess I have to delete the cache of the node or something like that. Is there a way to do so? The Script in the Node: #gim 2020-11-20 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE tabname = 'Spot Standard' #Name der Tabelle tab = vs.GetObject(tabname) #Handle zur Tabelle (numRows, numColumns) = vs.GetWSRowColumnCount(tab) #Zählt die Anzahl Zeilen und Spalten def frange(x, y, jump): #x entspricht der Startzeile in der Tabelle, y der letzten Zeile, jump ist die Schrittgrösse while x - y <= .000001: yield x x += jump list = [] list = [n for n in frange(2, numRows, 1)] #erstellt eine Liste, welche Zeilen aus der Tabelle ausgewählt werden sollen Artikelbeschriebe = [] Artikelnummern = [] for i in range(len(list)): Artikelbeschriebe.append(vs.GetWSCellFormulaN(tab, list[i], 1)) #Die Beschriebe sind in der ersten Spalte Artikelnummern.append(vs.GetWSCellFormulaN(tab, list[i], 2)) #Die Nummern sind in der zweiten Spalte #Name this = Marionette.Node( 'Popup' ) this.SetDescription('Zeigt ein PopUp mit den Werten aus der Tabelle "Spot Standard" und gibt Name und Artikelnummer weiter') #Input Ports #OIP Controls input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, Artikelbeschriebe) input.SetDescription('Die Auswahl aus der Tabelle "Spot Standard", Spalte 1') #Output Ports outputs = Marionette.PortOut('sArtikel') outputs.SetDescription('Artikelbeschrieb') outputn = Marionette.PortOut('nArtikel') outputn.SetDescription('Artikelnummer') #BEHAVIOR def RunNode(self): #inputs input = self.Params.input.value #Integer der Auswahl Artb = self.Params.Artikelbeschriebe Artn = self.Params.Artikelnummern #script outputs = Artb[input] outputn = Artn[input] #Aktualisierung der Wertetabelle tabname = 'Spot Standard' #Name der Tabelle tab = vs.GetObject(tabname) #Handle zur Tabelle (numRows, numColumns) = vs.GetWSRowColumnCount(tab) #Zählt die Anzahl Zeilen und Spalten def frange(x, y, jump): #x entspricht der Startzeile in der Tabelle, y der letzten Zeile, jump ist die Schrittgrösse while x - y <= .000001: yield x x += jump list = [] list = [n for n in frange(2, numRows, 1)] #erstellt eine Liste, welche Zeilen aus der Tabelle ausgewählt werden sollen Artikelbeschriebe = [] Artikelnummern = [] for i in range(len(list)): Artikelbeschriebe.append(vs.GetWSCellFormulaN(tab, list[i], 1)) #Die Beschriebe sind in der ersten Spalte Artikelnummern.append(vs.GetWSCellFormulaN(tab, list[i], 2)) #Die Nummern sind in der zweiten Spalte #outputs self.Params.input.value = Artikelbeschriebe self.Params.outputs.value = outputs self.Params.outputn.value = outputn Popup mit Werten aus Tabelle_2020-11-21.vwx 1 Quote Link to comment
Antonio Landsberger Posted December 23, 2020 Share Posted December 23, 2020 @DomC Any ideas? @Gregi To me this looks like either a bug or Marionette node OIP controls were never intended to be used this way. Quote Link to comment
Marionette Maven Marissa Farrell Posted January 4, 2021 Marionette Maven Share Posted January 4, 2021 OIP controls are not dynamic and there isn't a smooth way to do this at the moment. It's something I've been looking into for a couple of years now, I have some ideas in progress to get around the limitation, but they aren't completely set yet. I'll try to remember to update once I get things nailed down better. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.