AttributeUserText and BlockAttributeText - functional differences

I’m trying to use either AttributeUserText or BlockAttributeText to add information to embedded Blocks in my drawing files. Although these functions look similar superficially, they seem to work in very different ways and serve different purposes. Their naming is slightly misleading, to my eyes.

I’ve experimented with adding AttributeUserText to collected objects both before and after turning those objects into a Block. These are custom text attributes - things like part numbers, drawing callouts, etc. They are not driven by or derived from the object geometry.

If I assign them before the Block is created, then try to hook up other text that’s outside the Block, in a parts table or in the drawing space, they are not accessible using fx functions on that text object.

If the Attributes are assigned to the Block after it’s created, (stuck “on the outside”, as it were), then they are accessible.

All of these AttributeUserText’s are metadata attached to the object geometry. They don’t have to be visible on-screen.

Unless I’ve misunderstood, BlockAttributeText does have to be visible on screen, as text. Assigning it is a fussy process, to be done in a specific order. How to access it for edit after the fact is not at all obvious. It doesn’t show up in either the Properties panel or Block Definitions panel. It appears that it’s not metadata? It is solely text that’s visible on-screen. Is that correct?

I’m trying to work out when one should use one over the other. Strengths and weaknesses. The Help file documentation is written by/for someone that already knows what the functions are. It’s not great as a new learning tool. I’ve not found much in the way of online tutorials that make things clearer, either.

Can anyone point me in the direction of a good tutorial that covers this? Many thanks in advance for any insight or guidance!

Hey Matt -
This gets confusing rather quickly and I don’t know if I get all the questions right…

That’s correct. Attributes that are on an object that is in a block definition cannot be retrieved at this point. In my opinion, that’s a big issue, which has been on the list for quite a while.

At that point, they are on a specific block instance and that works just like any other object, yes.

Correct. They can be retrieved (unless when in a block definition) with a text field in an annotation object, but don’t require an annotation object.

That’s the purpose of the BlockAttributeText, yes, to have an annotation inside a block definition retrieve an attribute user text that is attached to a specific block instance.

I agree. I tend to use the somewhat obscure ConvertTextToBlockAttribute command. First just create the geometry and annotations that will go into a new block definition, then use that command on those annotation objects that will need to function as retrievers of information on the instance, and then turn everything into a block definition.

It should show up when you select a block instance and then go to the user text page for that instance in the properties panel.

It’s not about strengths and weaknesses, it’s about when to use what.

If you need text inside a block (def and instance) that refers to some unique property on a geometry object and need to be able to change that text in all instances by changing the property on the external geometry, use the AttributeUserText text field in text before turning that into a block. The text will always be the same in all instances.

If you need to show different text inside a block for each instance, use BlockAttributeText.

Let me know if I completely missed what you were wondering about.
-wim

Getting to grips with assigning AttributeUserText.

There is a rather annoying failing: If I set up a table, populated with placeholder text (a “#” or similar) then go to hook up that placeholder to an AttributeUserText key, there is no way to have the “#” removed before I hit “go”. I have to go in after the fact and delete it out afterwards.

That may not sound like much, but once you’ve had to do it 300 times, the novelty wears thin.

The whole AttributeUserText thing feels like it could be good. But it needs some real-world polishing and TLC to make it slicker to use. If it could be set up so that the placeholders were “primed” to sniff for a particular attribute text Key (part number, name, etc) and a row of texts selected when picking the object to harvest the data from (and do it without the need to post edit, as above), it would make the whole thing more attractive.

The basic building blocks are there. They just need hooking up to make them function more effectively in the Real World. A Rhino “Table” object would (or could) do that.

Hi Matt -

I’m trying to read between the lines to follow along in Rhino but not succeeding. I can’t find the Go button…
Could you add specifics, and perhaps a 3dm file?
-wim

“Go” was figurative, in this case. Apologies.

Make a Text. “#” (without the quotes).

Assign some set of AttributeUserText fields to an object. It doesn’t matter what the object is as it’s not Area, Volume, etc.. Something more like Name, Part Number, etc. In my case I’m dealing with images of a load of labels, so they are picture objects that I’ve turned into Blocks. Assign the Attribute after it’s been made into a Block, as discussed earlier in this thread.

Go back and select the Text “#”., then fx. Call up AttributeUserText, then the Select Object button. Pick object with the Attributes, then select one of the Keys.

The Attribute is immediately assigned and the dialogue window closes. There is no option to edit out the “#” before that happens. The Text stays selected, but you have to deselect it then re-select it to get the text to appear in the Properties panel. Or some other text edit window. Then you have can delete the “#” because it prepends the Attribute.

There needs to be an option to “overwrite existing data” or something along those lines, when picking the Key. Preferably a sticky check box in the dialogue.

Hi Matt -
I take it you are seeing this when editing the annotation text in the Properties panel only, correct`

That part I’m not seeing here on my machines. On my end, the text becomes deselected.
→ RH-98387 TextField: Selection is Not Maintained

That part works as it should, though.
When you leave “#” deselected and then ask to insert a text field, the “#” should not be overwritten.

Between selecting the object in the viewport and hitting fx in the Properties panel, you need to select the “#” string in the dialog if you want that to be replaced by the fx.
-wim

That makes sense. I’ve got it now :+1: .

Something I’ve just noticed is that if I select two text objects, select the “(varies)” text in the Properties panel, then try to assign an fx function, nothing happens to either text. I have to do them individually. Could this be tuned up to allow assignment to multiple selections in one pass?

Hi Matt -

In Rhino 9, selecting multiple annotation text objects and then using fx to insert a text field will overwrite all selected annotations.
-wim

Rhino 8: I’ve just found that if I select several texts, Ctrl-A then Delete, then assign an fx, it is applied to all entities. In the Properties panel, all that’s shown as being selected when I Ctrl-A is a single blank character space. But fx works.