SelName is certainly helpful, thank you! However, when this list gets longer and I am looking for a substring, I was hoping that a find method could help out as well. Since I am using a naming convention, I might want to select all objects that contain a *TA* or a W7*. Does this make sense?
Btw, I found some coding snippet that does what I am looking for, however I do not know whether I can use this as a simple script within Rhino (e.g. the Python version):
Here is a relatively simple script that may help -
It puts up a stringbox on the screen where you can type the search term. It allows for * as wildcards at the start, end or both start and end of the search string (not in the middle though). It will select all objects that have object names corresponding to the criteria. If no wildcard is used, the object name and the entire search string must match exactly. It is not case-sensitive (but can be made so). It will report the number of objects selected and also if any matching objects are locked, hidden or are on locked or off layers.
More sophisticated searches could be made with regular expressions, but perhaps this may be enough for you…
I learned about aliases and tried to run the script as an alias but for some reason I do not get the popup this way. Here is what I did:
On my Mac, I copied the script inside the library folder: /Users/dstaiger/Library/Application Support/McNeel/Rhinoceros/Scripts/SearchSelectObjName.py and restarted Rhino. Then I created an alias “FindByName” and set it to ! _-RunPythonScript SearchSelectObjName.py.
When I now use Cmd-K to run the alias, nothing happens other than a message displaying at the bottom in the status bar: Python Script <SearchSelectObjName.
I also tried variants without a .py ending and with/without “”, but still no luck.
That all seems like it should work… my Mac is unfortunately too old to run V7, but I can see if it will run in V6. Wait, what does Cmd+K do? Does the script run if you type out the full alias name?
OK, I can’t get it to work from an alias here on my Mac either - it works with RunPythonScript and browse to file on the desktop… @pascal can you test why?
There is a 6.0 or 7.0 in the path corresponding to the version of Rhino you’re running.
Ex: Library/Application Support/McNeel/Rhinoceros/6.0/scripts
Ah, so that means simply that the script is in the wrong folder… Hang on, going to check that now (for 6.0 at least).
OK, I can confirm that it’s working - thanks Alain! I will update the Wiki page and the Discourse topic (if I can) with this info…
Edit: Wiki page updated.
@wim - the Discourse post on this page - which people seem to find as per above - has information that needs to be updated. As the first post is two years old, I can no longer edit it, and putting new info with corrections at the bottom of a long thread will not be found easily… Any way to be able to edit that first post with the new info?
Using the correct folder path for the script is working fine. In my case for Rhino 7, it is /Users/myusername/Library/Application Support/McNeel/Rhinoceros/7.0/scripts.