Raph Posted September 17, 2022 Share Posted September 17, 2022 hi everybody I would like to be able to display text from different sources and display them in the symbol in a row. example: Prefix = inner dimension: Variable 1= 2000 Variable 2 = x Variable 3= 2500 Sufix= mm Result inner dimension: 2000x2500mm Can someone help me to find a solution Parametric Symbol test v1.1.vwx Quote Link to comment
Letti R Posted September 18, 2022 Share Posted September 18, 2022 Hello, you can use the "Concat" node to add a list of strings together. In your case you just have to convert the dimensions into strings with the "Str" Node before you put them into the ordered list. Than you can concatenate the list. Regards Letti Quote Link to comment
Raph Posted September 21, 2022 Author Share Posted September 21, 2022 Hi Letti Thanks for your reply. I have try and find a solution. Unfortunately now there are brackets, commas and apostrophes in the text. Example: dimension: [2000,'x',2500]mm Does anyone have a solution for me? Thanks in advance Parametric Symbol test v1.1.vwx Quote Link to comment
Letti R Posted September 21, 2022 Share Posted September 21, 2022 Hello Raph, i'm sorry, i seem to have changed the code of the "concat" node without remembering. It should work if you change the code of the "concat" node to: @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'Concat' ) this.SetDescription( "Concatenates a list of strings." ) #Input Ports stringIn = Marionette.PortIn('', 'listStrings') stringIn.SetDescription( "The input strings." ) #OIP Controls #Output Ports stringOut = Marionette.PortOut('s') stringOut.SetDescription( "The output string." ) #BEHAVIOR this.SetListAbsorb() def RunNode(self): #inputs stringIn = self.Params.stringIn.value #script newString = '' for s in stringIn: newString = newString + str(s) #outputs self.Params.stringOut.value = newString Unfortunately i cant post the vwx file because i just have an educational verison. Regards, Letti Quote Link to comment
DomC Posted September 21, 2022 Share Posted September 21, 2022 @Marissa Farrell Ist the behavior of the concat node WAD or should report a bug? I think it is a bug because it converts the list (List absorb) in a string. And then re-adds every character of that string together so the result is again str(self.Params.stringIn.value) Quote Link to comment
Raph Posted September 22, 2022 Author Share Posted September 22, 2022 (edited) Hi LEtti, Hi Dom, Hi everybody, Thank you for your answers. I wanted to change the text in the marionette node. But I have an error that appears. (see attached file) As a result, no changes are made. So I wanted to create a new marionette node. But I can't do it! Can you give me advice, tutorials or sources that show how I can create my own marionette nodes? Thanks in advance Raph Edited September 22, 2022 by Raph Quote Link to comment
Raph Posted September 22, 2022 Author Share Posted September 22, 2022 (edited) Hi everybody, OK I found a solution. I took a node that @DomC created and modified it see attached file Thank you for sharing your knowledge and helping me 😉 Now I would really like to learn how to make my own nodes so my question remains. Have you tips for learn to program in python for Vectorworks? Many thanks in advance Edited September 22, 2022 by Raph 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.