Rob87 Posted March 1, 2023 Share Posted March 1, 2023 Hi folks, searched for this, but couldn't find anything related. But wonder why nobody else needs this. Need: An Alert Information with a string input. The input comes from another node and differs... Need this to inform the user about what is done. F.e. "5 objects modified". 5 will differ and is one part of the string. Thank you! -Rob Quote Link to comment
Letti R Posted March 1, 2023 Share Posted March 1, 2023 Hello, i changed the existing "Alert Inform Dialog", maybe it fits your needs now. To create the node simply replace the whole code of any Marionette node with the code below. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'Alert Inform Dialog' ) this.SetDescription( 'Displays an alert dialog which provides the ' + 'user an information about the result of a ' + 'command. It offers no user choices.' ) #Input Ports input = Marionette.PortIn( None , 'item') input.SetDescription( "input" ) alertTxt = Marionette.PortIn( "" , 'str_alert') alertTxt.SetDescription( "input" ) advTxt = Marionette.PortIn( "" , 'str_advice') advTxt.SetDescription( "input" ) #OIP Controls minorAlrt = Marionette.OIPControl( 'Minor Alert', Marionette.WidgetType.Bool, False) minorAlrt.SetDescription( 'The severity of the alert: minor(true) or major(false)' ) #Output Ports output = Marionette.PortOut('item') output.SetDescription( "output" ) #BEHAVIOR # this.SetListAbsorb() def RunNode(self): #inputs input = self.Params.input.value alertTxt = self.Params.alertTxt.value advTxt = self.Params.advTxt.value minorAlrt = self.Params.minorAlrt.value #script if input is not None: vs.AlertInform(alertTxt, advTxt, minorAlrt); #outputs self.Params.output.value = input To create the string you can just add strings together with the "Str" Node if you put in a list of things (in your case an integer and a string). Regards, Letti 2 Quote Link to comment
Rob87 Posted March 3, 2023 Author Share Posted March 3, 2023 On 3/1/2023 at 6:40 PM, Letti R said: Hello, i changed the existing "Alert Inform Dialog", maybe it fits your needs now. To create the node simply replace the whole code of any Marionette node with the code below. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'Alert Inform Dialog' ) this.SetDescription( 'Displays an alert dialog which provides the ' + 'user an information about the result of a ' + 'command. It offers no user choices.' ) #Input Ports input = Marionette.PortIn( None , 'item') input.SetDescription( "input" ) alertTxt = Marionette.PortIn( "" , 'str_alert') alertTxt.SetDescription( "input" ) advTxt = Marionette.PortIn( "" , 'str_advice') advTxt.SetDescription( "input" ) #OIP Controls minorAlrt = Marionette.OIPControl( 'Minor Alert', Marionette.WidgetType.Bool, False) minorAlrt.SetDescription( 'The severity of the alert: minor(true) or major(false)' ) #Output Ports output = Marionette.PortOut('item') output.SetDescription( "output" ) #BEHAVIOR # this.SetListAbsorb() def RunNode(self): #inputs input = self.Params.input.value alertTxt = self.Params.alertTxt.value advTxt = self.Params.advTxt.value minorAlrt = self.Params.minorAlrt.value #script if input is not None: vs.AlertInform(alertTxt, advTxt, minorAlrt); #outputs self.Params.output.value = input To create the string you can just add strings together with the "Str" Node if you put in a list of things (in your case an integer and a string). Regards, Letti Thank you Letti! 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.