Layout - Assign UserText Attribute to Layout

Hi everyone

Is there a way to assign user text attribute to layouts? I know one can populate text on a layout with Document UserText using fx, but I’m wondering if there is a way to assign attributes for each layout so the values can be instance instead of global, and the values changes per layout. My end goal is to be able to read attributes of each layout and export them to a excel sheet, basically a Document Manager. When I use GetUserText on a layout ID, it gives nothing. Thanks in advance.

Hi David - I guess a trick would be to add an object to each layout that has the user text on it - a point would be all you need. If you add say Page Number as user text to a point object (or whatever) and copy/paste to each layout, the page number will be correct.


Thanks Pascal. Good suggestion, I haven’t thought about it that way so I will give that a try. Although, I can see one possible challenge with that is then to populate text objects on the layout with the user text info from that Point, and do that for all the layout in the active document. I will keep looking. Cheers

Hi Pascal, so I went ahead and did what you’ve suggested. I created a point in a layout at 0,0,0 then I create a bunch of UserText Keys and Values on that point (things that are unique to that layout, like layout revision number, layout title name). I also created Text Objects on that layout which reads the UserText Keys and display it’s values (just with the Fx setting in text). However, when I duplicate this layout, the new layout text will refer to the original layout because everything is reference to the GUID of the point in the first layout. So I’m still stuck. If I can assign attribute to layouts then that would be great, similar to Revit. Is there a plugin that can achieve this?

Yeah, of course that is true… the ID. I had tested it on a detail - cause it was already there - that I copied and pasted and it seemed to work, that just seemed more awkward as an object. I’ll fool around some more…


I like this idea. @Trav we should experiment with this for V7


Thanks Pascal and Steve. That will be a great addition as it helps with document control in Rhino.

I’m think if I can get the GUID of the layouts, then I can access all objects for each layout, filter them by Rhino Object Name (the layout text objects will be named) then maybe it’s possible to read the text value and push all that info into the point object or some other collector, then write that to excel. If the GUID is collected, then would it be possible to read the information from excel and update the text in Rhino?

fabtools does this, its a bit out of date but still works.

  • Add Layout From Template
  • Add New Layout
  • Change Detail View Object
  • Delete Layout

Thanks Rickson, I have used FabTools to batch produce layouts and update the detail views, but there is no way (i can find anyway) to extract the information on a existing layout using FabTools. Also, because sometimes information on a layout will need to be changed by a user manually after it is baked by FabTools, so I can’t just export the data from GH to excel either. :frowning:

Use the variable texts input in the Layout from Template, you don’t need to output to excel.

This works great in case you haven’t noticed…

I’m sure a lot of peoples in-house scripts do something similar, but for whatever reason they aren’t sharing. This community should be about open source growth, not holding on to an imaginary advantage. I liken it to Martial Arts, where at one point that was the way (for good reasons), now people share it all and its does nothing but grow the sport.

Hi Rickson, thank you for your reply, I’ve used the variable texts to populate other text objects on layouts, but what I’m after is a way to capture the info from all the layouts and push to a excel file so I can use it as document control for say, revision tracking. Also because the office uses other software such as inventor so the excel document manager would be the central control doc for both.

I have seen it being done, where one captures info from layouts and push to excel, and also updating the layouts by updating the excel and re-read from it.

I just added support to RhinoCommon to get and set user strings on the RhinoViewport class. This will be available in V6SR18 as well as this week’s V7 WIP. I also just added support to text fields to have the keyword “layout” instead of a Guid to the V7 WIP. We still need to add some user interface to this to make it usable.

1 Like

Thank you Steve, can’t wait to try it out. Cheer

i don’t understand why you would need to do that (push to excel) if you’re feeding the values from excel in the first place.

Hi Rickson, maybe I wasn’t too clear with my original question.

I’m not feeding the data from excel. The title blocks in the layouts are done with a combination of DocumentUserText, GH FabTools and manual imputs. I want to capture all of that info at end of the day and make a excel report for the Rhino document

gotcha, i’m looking forward to the new features as well.

Continuous improvements!

hi @stevebaer

So is a layout a RhinoPageView or a RhinoViewport? I think it’s a RhinoPageView, so is there a way to assign UserText to a layout with RhinoViewport class? Sorry if this is a stupid question. Thanks!

A layout is a RhinoPageView. A RhinoPageView is derived from a RhinoView which is what standard modeling views are.

A RhinoView contains a RhinoViewport. RhinoPageViews contain one main RhinoViewport and zero or more nested viewports (details). The RhinoViewport is what user text can be assigned to.

Thanks Steve