Rhino - Feature Request - Object Tags

Hello,

I think R8 has made some great improvements to layers (particularly the search functionality) yet I believe that adding support for Tags to object properties would be a great new feature.

Collaborative or multi-user AEC files can get… messy… sometimes despite everyone’s best efforts and the ability to quickly add, remove, or create new Tags to organize objects in the Rhino document really would be great.

Grasshopper does now have this ability to get and set tags via the Content Information node which is great!

I’m naively assuming this means that there is some kind of underlying API method handling this and that same API could (potentially) be extended to Rhino? Unless this is part of the new Model Objects containers in GH and therefore GH specific?

Either way it would be great to have this feature in addition to user text.

Alternatively, I may code a solution that leverages user text and just creates a key called “Tags” and then the Value field could read like “solid wood furniture, FFE, chair, Living Room” and the script could prompt a little dialogue in the viewport that allows you to add to this list.

This would be less elegant and having more refined control over a “tagging system” in Rhino would be preferred IMO.

Here’s a quick UI mockup of what I think this could look like and work like:

-A new Rhino command called “Tag” would be added
-User could Right Click on any object and choose “Tag” or “Tag Group”
-User could enter command line “Tag”
-A dialogue UI would pop-up in the viewport floating to the upper right of where a right click occurs or slightly to the upper right of the objects bounding box center (if Tag was run from commandline)
-User could start typing anything and hit enter to tag the object.
-User could add multiple tags at once by typing with commas such as “Tag1, Another tag, Yet Another Tag” and hitting enter
-A new sub panel would exist in the Object Properties sub panels called “Tags” where a user could drag and drop “Ungrouped” Tags into new “parent” Tag Groups, add new tags easily, or remove existing tags.
-User could assign a color to each Tag Group (optional)
-User could collapse or expand Tag Groups
-By default, unless grouped via “Tag Group” command or Dragging & Dropping Tag into Tag Group in UI, all Tags would be set to “Ungrouped” by default.
-User could Search in tags much like the way Search works for User Text
-Subpanel would also have a button for “Match Tags”

-Users could Select By Tag, Group By Tag, Ungroup By Tag, etc. (new Rhino workflow use cases)

Not only would this new feature empower users to have additional filtering, sorting, and management of data and information but this could open up new workflow opportunities such as hybridized layer based modeling augmented with Tags, Tag only workflows (where no layers are needed), etc.

This could also assist users working in complex files where they may not be allowed or want to change layer structure of items but would still like to add their own rules to filter objects against (similar to selection sets but more powerful as they could apply additional rules to said objects or expose to grasshopper for additional logic, such as (get overall dimensions of all objects tagged “dining room” and “furniture”)

I’d love to know other users thoughts and the developers’ thoughts as well of course.

Similar discussions:

Thank you all!

1 Like

Tags can go on any object, the only UI access at this time is only available in Materials.

2 Likes

Fascinating, why are they located in the materials pane if they can go on any object? Or is that a more recent chance? I just ignored this area entirely as I thought these tags were for materials only.

Thanks @Japhy

Being so universal creates Rhino UI challenges, i think there is a youtrack, if not i’ll get one going.

1 Like

Of course, that makes sense. And yes Ive been making extensive use of the Tags within Grasshopper but really hoping for more user friendly access from Rhino itself.

Thanks Japhy

1 Like

FYI @Japhy , it appears that if there are no materials in the Rhino model, clicking the Tags… menu item will yield nothing. The dialogue only appears after adding a material to the model and then clicking the Tags… menu item, I guess this is because it’s tagging the material only?

Furthermore, it appears that the Tags exposed via the Material Properties are not queryable from anywhere other than that particular dialogue. Is that true? It appears that the Tags are simply a way to only tag materials and then filter for specific materials but have no bearings on the Object themselves. Is that correct?

Additionally, these tags do not seem to be connected at all to Grasshopper, you can see in the snip after assigning Tags to an object via the Material Properties, nothing is returned from the Model Objects::Tags in GH and nothing appears to exist in the Model Material either:

For the time being I’ve started implementing a basic Tagging functionality via a macro running a python script that will leverage User Text with a Key called “Tags” and then prompt the user to enter tags/add tags that update the User Text Value.

It allows you to add tags to single objects or multiple objects at once, if a tag already exists, it won’t append it, and regardless of how the user types, it will default the text to be lowercase always for consistency.

While this isn’t particularly powerful at the moment, I can at least filter against the concept of Tags now via scripts and Grasshopper definitions.

Here’s a video of that basic implementation:

Maybe someone can come along and make something more robust?

I really would like to implement a shortcut that pops up a dialogue near the object being tagged as I sometimes find the command line a bit tedious or “far away” but that’s a an exercise for another time I suppose and probably needs some ETO or display.pipeline work which i’m only just beginning to look into.

Here’s the Macro command code for anyone who wants to play with it:

NoEcho

! _-RunPythonScript
(
import rhinoscriptsyntax as rs

def append_tags(obj, additional_values):
    existing_value = rs.GetUserText(obj, "Tags")
    if existing_value:
        existing_values = existing_value.lower().split(",")  # Convert existing values to lowercase and split them
        new_values = [val.lower() for val in additional_values if val.lower() not in existing_values]
        if new_values:
            new_value = ",".join(existing_values + new_values)
            rs.SetUserText(obj, "Tags", new_value)
            print("Tags appended successfully.")
        else:
            print("No new tags added. Tags already exist.")
    else:
        lowercased_values = [val.lower() for val in additional_values]
        rs.SetUserText(obj, "Tags", ",".join(lowercased_values))
        print("Tags set successfully.")

# Check if objects are already selected
selected_objs = rs.SelectedObjects()
if selected_objs:
    # If objects are selected, prompt the user for the value directly
    value = rs.GetString("Enter the value for Tags (separate multiple tags with commas)")
    if value:
        tags = [tag.strip() for tag in value.split(",")]  # Split multiple tags by comma and remove leading/trailing whitespace
        for obj in selected_objs:
            append_tags(obj, tags)
else:
    # If no objects are selected, prompt the user to select objects
    objs = rs.GetObjects("Select objects")
    if objs:
        value = rs.GetString("Enter the value for Tags (separate multiple tags with commas)")
        if value:
            tags = [tag.strip() for tag in value.split(",")]  # Split multiple tags by comma and remove leading/trailing whitespace
            for obj in objs:
                append_tags(obj, tags)
        else:
            print("No value entered. Tags not set.")
    else:
        print("No objects selected.")

)

EDIT:

Working on the Eto dialog over in this post:

3 Likes

These are available in GH, but still very limited in Rhino

Ahh, thanks @Japhy, I didn’t think about connecting the Content Information to the Model Material output itself. That makes sense though.

Thank you for the information!

If anyone stumbles upon this I (along with a few other forum users) put together a script in this post over here that you can set to an alias, macro, or run via the script editor.

It’s a basic dialog that allows a user to add single or multiple tags to an object or objects, delete said tags from an object or objects, and search through the existing tags easier.

The current implementation stores the tags as a .csv string value in a user text entry called Tags which can be exposed to GH, exported, etc.

Cheers!

2 Likes