# Connecting points by "id", issue!

## Recommended Posts

Hi guys,

I would like to connect some points based on their "ptnum", using an attribute called "id".

The problem is it doesn't work. How can I fix it?

Thanks for helping.

Connect Points.hip

##### Share on other sites

That's because all your IDs are unique. Add can only connect a series of points that share the same ID. Try altering your wrangle to this and observe the result.

```if (@ptnum==0){i@id = 0;}
if (@ptnum==1){i@id = 0;}
if (@ptnum==2){i@id = 0;}
if (@ptnum==3){i@id = 1;}
if (@ptnum==4){i@id = 1;}
if (@ptnum==5){i@id = 1;}
if (@ptnum==6){i@id = 2;}
if (@ptnum==7){i@id = 2;}
if (@ptnum==8){i@id = 2;}```

I often use Add following a trail sop out of particle system to create lines from a particle in motion. Trail count becomes line length in that type of setup.

Edited by Atom
##### Share on other sites

Wow, I never knew that. Thank you.

##### Share on other sites

On 10/27/2022 at 9:18 PM, Atom said:

That's because all your IDs are unique. Add can only connect a series of points that share the same ID. Try altering your wrangle to this and observe the result.

```
if (@ptnum==0){i@id = 0;}
if (@ptnum==1){i@id = 0;}
if (@ptnum==2){i@id = 0;}
if (@ptnum==3){i@id = 1;}
if (@ptnum==4){i@id = 1;}
if (@ptnum==5){i@id = 1;}
if (@ptnum==6){i@id = 2;}
if (@ptnum==7){i@id = 2;}
if (@ptnum==8){i@id = 2;}```

I often use Add following a trail sop out of particle system to create lines from a particle in motion. Trail count becomes line length in that type of setup.

`i@id = @ptnum % 3;`

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×
×