Jump to content

for each attribute value vex equivalent


sekow

Recommended Posts

I am having this problem at hand where I need to loop thru clusters of points and calculate the average position. These points are organized with a cluster id attibute (clsID). Can't really figure out how to do this in VEX.

So far I have a For Each Sop (looping thru each attribute value) with two attrbPromote Sops attached in line. First is promoting @P to detail attribute ('center') via average, second is reapplying @center to points again.

 

Help is much appreciated

 

-sebastian

Link to comment
Share on other sites

in vex you could use nuniqueval() and uniqueval() to iterate over attributes. the following link might put you on the right track: http://forums.odforce.net/topic/20814-need-help-with-python-vex/?p=124375
if it doesn´t has to be vex, the attached example is probably the easiest way to do it...

 

hth.

petz

centroid.hipnc

Edited by petz
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...