User Text - Component Request

I’ve been using the User Text component since it was introduced and it works great.

However, I have one important feature I would like considered and that is the ability for a value change in Rhino to override the the user text on a per instance basis.

Currently the way ‘Merge’ works is that it will overwrite the value in the key/value pair anytime the Model Object gets baked but what I want is:

If the Key does not exist, add it along with it’s Value pair

If the Key exists and the Value is blank, add the Value
If the Key exists and the Value has changed (but not empty) keep the Value that was changed in Rhino.

This would allow Rhino Objects to have user text default values assigned while being able to have the values overridden on a per instance basis, allowing user text to be utilized more like Instance Parameters in other software.

I did manage to get this working with a cluster that compares the key/value text but is a pretty overly complicated cluster and I would love to have a default option or even have Merge act in the way I described.

Please let me know your thoughts,

Thank you!

I would personally like this to work in a different way, where non-existent keys are added to the object, but the values are kept as is (if there is already a value assigned) or left blank. The idea here is that you can then automatically assign the right keys to geometry (e.g. you feed in geometry from a certain layer and every object on the layer will then have the attributes that you can manually alter).

A query user text component would also be nice to have.

1 Like

I think we are saying the same thing from two different sides of the coin?

Here’s a simple example of the workflow from my perspective (just my two cents):

Example:
If I have a layer called “Doors”, I will query the objects on that layer and assign default user text.

Let’s say I want every object on “Doors” to get user text like this by default:

Keys:
Height
Width
Swing Angle

Values:
6’-8"
3’
90

If I add a new object to the “Doors” layer, I want the user text to get populated with this default user text.

-If I modify the swing angle value to say 45, then that value will stay 45.

-If I delete the Swing angle value, it will get repopulated to the default value.

-If I delete the Swing angle Key, it will re-add the Key with the default value again.

This way, I can have logic in GH that always has consistent values to work with by default but allows users to override on a per instance basis.

Additionally, I can then query the user data on the back end and group data accordingly.

Example:
-If Doors have matching Key/Value pairs for all user text fields in the default Key/Value list, I can assume these are the same door type.
-If some doors have all matching K/V but differ on swing angle, same door type still, but visually the door can be open/closed for example
-If some doors have all matching K/V except for height and thickness, I could group that as a separate door type and populate a door schedule or Bill of Materials accordingly

Here’s a snip of the Door example:

Same Door object (point) but I moved the position, set the Count to 2, and set the Swing Angle to 45:

Both these doors are being created with the same algorithm, the User Text is the only thing changed.
If I try this workflow with the current User Text component, the user set values will be overwritten every time the object is re-baked, and I need it to be re-baked since the position physically changed and is actual geometry (not just custom preview).

However, I solved this issue with a cluster I created that only modifies the User Text if the values are blank essentially, meaning it populates the default values initially and then leaves it alone unless you hit “use default parameters”.

But I really would like for this to be a native feature of the User Text component, or at least optionally be so.

PS:
The User Text component can be used as a “get” component to query the user text of Model Objects and also the new “Group Content” and “Filter Content” nodes will allow you to organize/filter data by User Text attributes or Object Attributes. It’s very powerful and quick to make a data tree out of nearly any object/user text value(s) now. (one of my favorite new nodes)

2 Likes

I’m also looking for the same workflow as you. Unfortunately, there’s an issue with the bake component that I cannot trigger it with a boolean value to update. New Grasshopper bake component issue with a true/false input for baking?
It would be nice if there was a user value bake component as well, to immediately modify key values.

In addition, the current Filter content can only access one key and you can only search for a specific key value. But comparing a series of keys to the keys in User text is not as straightforward as it seems right now.

1 Like

Here’s how I’m handling the baking. You can bake the “data” so to speak without baking geometry.

So if you bake a model point and the only thing that changed was the user text, it will add that to the model point and any logic referencing said model point will still function the same downline.

Ref Points On Layer → Assign Default Params If None Present → Bake Params → “re-reference” updated model points from the bake output:

You’ll notice the cluster boolean output is False because all points already have all possible key/values assigned, if you put a new point on the layer or delete a default key or value position, it will trigger true, then bake again, then immediately be false again because the condition will be met that all values exist.

That cluster is a spaghetti mess admittedly, hoping to simplify soon…

@michaelvollrath You may want to have a look at this script, it bakes default keys and values for every new object in a layer. There’s no need for spaghetti, it bakes based on missing keys.

Update keys with layer change.gh (18.7 KB)
Masterplan - centrelines.3dm (120.4 KB)

P.S. You should have already downloaded this 3dm file from another topic.

Thanks @Intuos , I’ll take a look! If a user overrides the objects User Data value in Rhino does it keep the user defined value still?

I’ll dig in, thanks for sharing and being my attention to it!

@michaelvollrath Not if you add new values and keys, but you could select all geometry and add the value and key first and add it afterwards in Grasshopper. That should make it foolproof, I tested it and it does the trick.

I filter the geometry for the keys, so it only adds key+value pairs for geometry that does not have the complete key+value pair.

1 Like

Or actually, it doesn’t have the pair, because the key didn’t exist. That’s the more correct explanation.