Jump to content

Increment a value in a point wrangle


Recommended Posts

Hi;

I have a point wrangle set to run on a set number of arbitrary points (say; 12 22 11 41) What I want to do is to set another incrementally increasing integer that starts from 0 going all the way up to 1-number of points run through (considering the previously mentioned example; 0 1 2 3 for 4 points set in as a group to run over) I can't use a for loop since a for loop runs for each point wrangled :( I tried using 'int i = 0; i++;' but that didn't work either. How would it be possible to get this done?

Thank you ^_^

AJ

  • Confused 1
Link to comment
Share on other sites

16 minutes ago, forever_kk said:

use detail wrangle

 

Yes, I tried using detail but I couldn't figure out how to write to a point integer array attribute from within detail :(

Link to comment
Share on other sites

int pts[] = expandpointgroup(0, chs("group"));

for(int i = 0; i < len(pts); i++)
{
    setpointattrib(0, "num", pts[i], i);
}

Here's a simple way to do this in a Detail Wrangle. This will also work with ad-hoc groups.

Edited by dleonhardt
  • Thanks 1
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...