[VEX] How to setdetailattrib() to a dictionary?
2668
1
1
Andr
Member
900 posts
Joined: Feb. 2016
Offline
Dec. 7, 2020 6:29 p.m.
I need to build a detail dictionary with key/values from point attributes.
Ideally something like this in a point wrangle would work:
setdetailattrib (0 , d@mydict [itoa (@ptnum )], myvalue , "append" );
The offender is the second argument of course, as it is expecting a string.
Edited by Andr - Dec. 8, 2020 07:30:01
Andr
Member
900 posts
Joined: Feb. 2016
Offline
Dec. 8, 2020 7:34 a.m.
So I managed to do it from a detail wrangle with a for-loop.
My only question: is there a more direct way to assign the key values without using the intermediate dummy array?
for (int i =0 ; i <@numpt ; i ++)
{
string key = point (0 , "key" , i );
int dummy [] = d@mydict [key ];
append (dummy , i );
d@mydict [key ] = dummy ;
}
Attachments:
point att to dict.JPG (96.4 KB)