TOPS - Wedge string/group attribute value

   353   2   0
User Avatar
Member
5 posts
Joined: 7月 2024
Offline
Hello,

I'm stumped in setting up a simple Wedge to drive a group attribute for a Blast SOP. I'm trying to iteratively go through an existing group attribute that I have in my point cloud, delete-non selected groups and export for each group.

I cannot figure out what to type in the Wedge node in order to get a string value for my Blast SOP's group input parameter.

e.g. I have a point cloud with a group attribute for ea point of "classIndex0, classIndex1, classIndex2...etc"

I've tried setting up an integer attribute output (called "index") in the Wedge node to get the integer at the end.
Then in my Blast node I tried typing this to reassemble the group name -
`strcat("classIndex", itoa(@index))`

but it doesn't work, I get an error "Unable to evaluate expression".

--------------
Is there a better way to go about this?
Can Wedge output a string value with an incremental integer in the same string? This would be most straightforward way to me, but I can't figure out the syntax/expression/code to do this simple thing.
Edited by LearningPointCloud - 2024年8月25日 22:47:36

Attachments:
hdi_wedge_01.png (33.6 KB)
hdi_blast_error_01.png (34.2 KB)
hdi_grpattrb_01.png (48.2 KB)

User Avatar
Member
285 posts
Joined: 1月 2013
Offline
There are many ways to do this attached a scene with an example. But I would like to point out that there is no itoafunction in HScript Expression and you don't need to concatenate strings in the group parameter, you can just write classindex`@index`.

Attachments:
blast_by_wedge.hipnc (304.7 KB)

User Avatar
Member
5 posts
Joined: 7月 2024
Offline
Thanks for sharing! That clears up alot for me, I always feel like I'm on the edge of solving it but can't figure out the correct way to get it going.

I did use chatGPT and it suggested the itoa function...
I find it quite confusing still to know what function/syntax to use.
  • Quick Links