User Text Field on Block

Hi,

while creating architectural drawings, I’m trying to make a block, that would contain “Room number”, “Room description” and “Floor area”.
While the first two are normal user text, the area should be a text field function, the User Data on a object doesn’t seem to allow to pick another object to read the Area from. Is there a way to get the block to read the area of a curve?
The curve can be hand-picked, a way to choose the the curve with the closest point on curve to the block insertion point automatically would be ideal.

Cheers,
Ivan

You could build yourself a small Grasshopper player script that can do that. It’s not super easy to work with blocks in GH, but using the Human plugin I find works pretty well.

There you could then build yourself a system that asks for the object to get the area from and then updates the user data attached to the block.

Thanks, this should also be quite easy to script, but it looks like the functionality should be there by default, so I just feel like I’m missing something.

True. You mean like smart user data fields? But where would you set this up if not in Grasshopper or Script? I have not heard or seen that this is possible any other way in Rhino.

Yeah… forgetting about the “autopick” option. I can pick another object’s Area as a function in a simple text object. But as soon as I try to add this function to the User Data Field, Rhino allows me to pick the Area Function from the list of functions, but doesn’t allow me to pick any object and only works on itself… which doesn’t make much sense in case of a block. But the option is there to add the Area function to the user text via clicking a button. That’s what has me confused.

It is possible to do what you want in Rhino 8. Basically you can’t directly select the curve, but you can enter the code to print the area of your curve in the text field of your block.

  1. Create two text objects for Room Name and Surface each filled with a “BlockAttributeText” textfield
  2. Turn these two text objects into a Block (on creation enter any value for the text fields)
  3. Manually enter the Room name
  4. Select the curve of you room (outside of the block). Hit Properties > Attribute User Text
  5. Hit the fx button (the one above the search field). Select “Area”. Hit OK.
  6. Hit the fx button (the one right to the value column) of the new Area entry, copy the FX.
  7. Paste it in your block’s attribute field for Area.

See example file below if necessary

attribute_room.3dm (2.5 MB)