How to sort and reposition a set of geo based on attribute

   2091   7   1
User Avatar
Member
6 posts
Joined: March 2016
Offline
Hello friends,
I was recently asked to rearrange some geo based on their attribute values using for loops. I hope i'll find some help here. Should be easy enough

AEFHIKLMNTVXYZBCDGJOPQRSUW

They have their individual textsymbol and textindex values.

I managed to do it by packing them and copying points on their location, then in the for loop replacing the position to the ordered points but they are separation is uneven. If there is a better way to go about it please let me know.
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Do you have an example HIP file?

The Sort SOP can sort points based on an attribute, and then you could use the point number to compute a position, instead of the attribute value. An example file would help get a better idea of what's going on, to try to help, though.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
6 posts
Joined: March 2016
Offline
there's something wrong with my uploads i think. I am not able to upload the file.
I clicked on this orange upload button, selected the file from the explorer then clicked on the tick.
Then hit submit.
Am i doing something wrong?
Edited by sparsh_goldeneye - May 3, 2017 13:04:09
User Avatar
Member
8582 posts
Joined: July 2007
Offline
just don't click on the tick, that's for deleting it
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
6 posts
Joined: March 2016
Offline
Oh ok.. here you go.
I managed to find a better solution to the problem though. Please go through it and lemme know if it can be improved.

Attachments:
sortThis.hiplc (106.8 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
It looks like you can simplify it a bit, using the Sort SOP. (See attached)

Attachments:
sortThis_Simplified.hiplc (76.1 KB)

Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Oh, also, the forum UI for uploading files has now been simplified a bit, since you were certainly not the only one who thought they were uploading a file but weren't. Your description helped make clear what the confusion was in the UI, so thanks!
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
6 posts
Joined: March 2016
Offline
Thank you very much for sorting out my problem and i'm glad to be of help
  • Quick Links