AlHanson Posted April 15, 2020 Share Posted April 15, 2020 I've been using the Ordered List along with the Concatenate Node to combine strings for my tools for a while now and have never had any issue with it. Recently, I've been having trouble getting this to function correctly as it has started giving me a list style string. In this example I'm just trying to create a simple #/# value display- just a simple / between two string values. I should be getting 1/23 from this however I'm getting ['1', '/', '23']. I've generally been working with the ComputerWorks Easy Text node, so I checked this against the stock Text node and the problem exists here too. The weird thing is that if I go back to my tools that have used this exact same method to generate text and copy/paste the Ordered List & Concat nodes into the file they work just fine and produce the previously expected results. Checking the script in the newly inserted nodes versus the copied node shows no difference- they match up exactly. Example file attached. Very confused with this and looking for some help or guidance on a better method for building strings? TextConcat.vwx Quote Link to comment
DomC Posted May 6, 2022 Share Posted May 6, 2022 As the concat node is, it converts the input to a string and then loop the character and adds them. #inputs stringIn = str(self.Params.stringIn.value) #script newString = '' for s in stringIn: newString = newString + s #outputs self.Params.stringOut.value = newString I am not sure but I would expect from this node, it should do something like this: #inputs stringIn = self.Params.stringIn.value #script newString = '' for s in stringIn: newString = newString + str(s) #outputs self.Params.stringOut.value = newString 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.