wateryfield Posted July 22, 2014 Share Posted July 22, 2014 Hi, Guys. I was stuck by a simple VEX question. How can i get a string attribute, such as "s + @ptnum". s@name = "s + @ptnum" ; not working at all. I was lack of VEX expression experience. : D Thanks! Quote Link to comment Share on other sites More sharing options...
rayman Posted July 22, 2014 Share Posted July 22, 2014 strcat("string", ftoa(@ptnum)) Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 22, 2014 Author Share Posted July 22, 2014 strcat("string", ftoa(@ptnum)) Thanks, Rayman. But s@name = strcat("s", ftoa(@ptnum)); seems not working in point wrangle. AttrubCreate can built a string attribute just use " s$PT ". Quote Link to comment Share on other sites More sharing options...
rayman Posted July 22, 2014 Share Posted July 22, 2014 (edited) my mistake... s@name = concat("s", itoa(@ptnum)); Edited July 22, 2014 by rayman 1 Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 22, 2014 Author Share Posted July 22, 2014 my mistake... s@name = concat("s", itoa(@ptnum)); Thanks! I get the answer too. It was inside the voronoifracture sop ,there is a attribWrangle create the string name. Yours was much clear. Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 22, 2014 Author Share Posted July 22, 2014 my mistake... s@name = concat("s", itoa(@ptnum)); And one more question. How can i slice the spring use VEX. If i have a string attribute "piece88", how can i get the 88 . Is any more comprehensive help page can i get some useful VEX expression. Sometimes i was clueless when meet new problems. Quote Link to comment Share on other sites More sharing options...
rayman Posted July 22, 2014 Share Posted July 22, 2014 (edited) well.. you can try split function, but i`m not sure it will work: string[] split(string s) string[] split(string s, string separators) try something like this(I did not tested it): string sep = "piece"; string intValue[] = split("piece88",sep); int id = atoi(intValue[0]); Edited July 22, 2014 by rayman Quote Link to comment Share on other sites More sharing options...
rayman Posted July 22, 2014 Share Posted July 22, 2014 (edited) Is any more comprehensive help page can i get some useful VEX expression. Sometimes i was clueless when meet new problems. http://www.sidefx.com/docs/houdini13.0/vex/functions/ Just use doc page and use find command on your browser. For example type "string" to search for string related functions. Edited July 22, 2014 by rayman 1 Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 23, 2014 Author Share Posted July 23, 2014 well.. you can try split function, but i`m not sure it will work: string[] split(string s) string[] split(string s, string separators) try something like this(I did not tested it):string sep = "piece";string intValue[] = split("piece88",sep); int id = atoi(intValue[0]); Thanks, i will have a try soon. http://www.sidefx.com/docs/houdini13.0/vex/functions/ Just use doc page and use find command on your browser. For example type "string" to search for string related functions. Thanks. Quote Link to comment Share on other sites More sharing options...
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.