Document Text missing

In RH5 we had a script that we used to add DocumentUserText to our drawings in order to fill out the Titleblock on multiple sheets at once.

def RunCommand( is_interactive ): Keys = ['CLIENT','LOCATION','PROJECT','TITLE','DRAWER','CHECKED','APPROVED','DRAWINGNO','REVISION'] Key = rs.ListBox(Keys, "Select Attribute to edit") Attribute = rs.GetDocumentData("Block",Key) Attribute = rs.StringBox(message=None, default_value=Attribute, title=None) rs.SetDocumentData("Block",Key, str(Attribute))

It would create something like this in the DocumentUserText:

Block\CLIENT | ClientName

*Note that the script inserts a backslash.

If I use the command ‘DocumentText’ Nothing shows up. If I go to the Options > User Text, then I can clearly see my user text exists. After closing the file and re-opening it, the ‘DocumentText’ command will show all the created Document Text that didn’t show up before.

Hi jcparks - the Rhino top-level command is SetDocumentUserText/GetDocumentUserText. Is that what you meant?


We are using SetDocumentData/GetDocumentData in order to take advantage of the Sections capability. We are using other sections of the Document Data and want to keep this titleblock information separate. My understanding was that DocumentUserText would show all document data, it just separated the Section/Key | Attribute.

I think this is related somehow to this DocumentUserText Text Functions don't like backslashes

The backslashes were removed from the text functions when I opened the file in RH6, and I had to add them back.

@jcparks from the sounds of things it appears like somethings fishy during the doc change event that should take place after your script runs.

If you do a simple test with something like


Does the panel update after the script is ran?

@Trav, thanks for the help. I started with a blank template, added text fields, then used your simple test. Everything worked - The panel updated with Section\Key | Value, and the text fields immediately updated as well.I also ran my script on the blank template and it correctly added the Section\Key | Value.

I also went back to my multi-sheet drawing and did some updates on the DocumentData using my script. Everything was working and I noticed the text updated immediately, but there was a bit of lag before the DocumentText panel updated.

I’m not really sure why I was having issues earlier, but I suspect I may have manually entered some forward slashes which added to my confusion. If I have further issues, I’ll update this thread.

@jcparks Thanks for the update. Let me know if you have any more issues and I’ll be glad to try to figure it out with you.


@Trav, i got a file here containing DocumentUserText which displays differently in V5 and V6. There is one key which displays in both versions using GetDocumentUserText and 3 keys which only display in V6 in the dialog. Can i sent it directly to you without posting ?


@clement absolutely. email it to me or pm a link. travis @