These 3 nodes are the basis of my inquiry:
1) Intersection analysis creates sourceprim array attribute on points
2) add_detail_array - contains 1 line run over detail to add a detail array attribute. I tried creating the detail attribute on the fly in lower node but wasn't working. This works for now though.
i[]@lowestprims = array();
3) add_lowest_prims_to_detail_array - What I'm trying to do here is simply run over all points and add the lowest prim number in the sourceprim attribute array to a detail array attribute.
int prims[] = i[]@sourceprim; int lowestid = 99999; for (int i = 0; i < len(prims); i++){ if (prims[i] < lowestid) { lowestid = floor(prims[i]); } } int success; int existingList[] = getattrib(geoself(), "detail", "lowestprims", 0, success); i[]@oldExistingList = existingList; if (find(existingList, lowestid) < 0) { append(existingList, floor(lowestid)); i[]@existingList = existingList; setdetailattrib(0, "lowestprims", existingList ); }
You can see in the code above I'm grabbing that sourceprim array, finding the lowest value, and then trying to append it to the detail attribute if it's not already in there. However, existingList is ALWAYS empty after the getattrib function call.
Does anyone know a way to do this or what I'm doing wrong?
Thank you!