GetUserText command only allows selecting one object at a time. I recall I could select multiple objects and Rhino would return the user text for all the selected objects, one at a time is useless.
I can set usertext for multiple objects why not retrieve the same way or is this broke?
From the help file:
Retrieves text information attached to an object using the SetUserText command. This information can also be retrieved by .NET plug-ins and VisualBasic scripts.
Select objects. (Here the help file says objects but currently Rhino only allows selecting one object)
Type a text key or press Enter for all keys.
Hi Roland- Setting user text for multiple objects is clear enough, but just off hand, I cannot think of how I’d use getting user text for multiple objects outside of a script that allowed me to sort through the results… what did you have in mind?
Yes you guessed it, it’s for a script I’m looking into writing.
I’m doing a lot of ceramic tile layouts and now I want to count all the different types of tile contained in the job for a BOM report. I’m checking my options I’m trying Grasshopper, paneling tools, and Rhino script.
Blocks won’t work because I need to trim tiles depending on their location on the wall but in this case they must still be counted as full tiles as the installer will cut them on the job. Thus I thought I might use user data but not being able to multi select makes this method useless to me. I’m almost complete with GH but there seems to be a few ways to do this that I want to explore.
I guess I could write a script that:
Checks length and width of tile/ rectangle enumerates that but then trimmed tiles are a problem. I then thought maybe I can assign user data to all similar tiles like all 8 by 2s by selecting them along with the trimmed 8 by 2s and assign “8by2” userdata to that entire selection and in this case the trimmed tiles will still report what they are but retrieving the data might be problematical if I can only select one object at a time. I haven’t tried a full blown script but I gather using a for each loop would get around this?
I’ve found a few ways to automate tile laying with grout lines in GH that works really well. I found two ways one is with paneling tools and the other is with linear array.
Exciting stuff as it makes doing these layouts really easy and gives fast visual feedback. All these tiles are hand made and the layouts depending on location get complicated.
Thanks for your quick reply and any advice.
In that case you should be able to sequentially get the data from a multiple selection inside the script, no? Just iterate through the array of selected objects and query each with Rhino.GetUserText()?
is there a way to select objects by key/value?
let’s say I previously set 5 objects to key:material and value:metal.
Now i want to select these objects by texting those key/value.
Do i have to iterate each objects on the document in order to check if they have that usertext? or there is a proper command? (if the latter, i wasn’t able to find it)
FindByUserString(key, value, etc)
do you know how to search any object that has the same key in the case I don’t care the value of that key???
if i put None in the value variable it does’t work!