kev2 Posted October 15, 2016 Share Posted October 15, 2016 (edited) Hi, If I use an attribute wrangle to create an array attribute and populate the array like so: i[]@stuff = nearpoints (0, @ape, 1, 23); I can then slice the array like so: i@branch = @stuff[3]; and all is good in the world. However, if I attach another wrangle node and try to use the same slice, I get an error even though the array attribute shows up in the spreadsheet? Not a showstopper but I'd love to know why the attribute isn't accessible. Edited October 16, 2016 by kev2 Quote Link to comment Share on other sites More sharing options...
bonsak Posted October 15, 2016 Share Posted October 15, 2016 I don't know why that doesn't work, but this seems to work: i@the_slice = i[]@opinput0_stuff[3]; -b 1 Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 15, 2016 Author Share Posted October 15, 2016 Oh, nice trick Bonsak. Works for me too. I'll give this post a couple days and submit it to support if no one can explain it. Maybe its not supposed to for some reason. Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 15, 2016 Author Share Posted October 15, 2016 And, i@the-slice = i[]@stuff[3]; also works so it appears to need the [] prefix for the vex snippet to pick up an array attribute. Quote Link to comment Share on other sites More sharing options...
bonsak Posted October 15, 2016 Share Posted October 15, 2016 Good to know. Less typing -b Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted October 15, 2016 Share Posted October 15, 2016 if you don't declare the attribute type the first time you call it it defaults to float 1 Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 16, 2016 Author Share Posted October 16, 2016 (edited) For completeness, all I needed to do was declare the array as itself: i[]@stuff = i[]stuff; and then it picks up the array so that i@branch = @stuff[4] works fine now. Thanks @david for the assist. Edited October 16, 2016 by kev2 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.