anyone possibly have a script to do this? thanks in advance
Are you looking to have the user specify the prefix/suffix each time, or is it constant? Separator between the original text and prefix/suffix?
I think Mitch is on itâŚ
-Pascal
Here are a couple of quick hacksâŚ
AddPrefixToText.py (750 Bytes)
AddSuffixToText.py (749 Bytes)
thanks mitch!
Tried using this when I figured out I can´t read: is it hard to modify this so that I can add prefixes and suffixes to object name. Like selecting objets named X, Y, Z, using the command writing â-51â and getting objects named X-51, Y-51, Z-51 respectively?
It´s strange one would need a script for that. Is there a function that does this? I couldn´t find anything like this.
There are literally hundreds of these types of âspecial requestsâ with different variations that are posted here, to have native commands/procedures for them all would be far too much (IMO) when they can easily be custom scripted.
To clarify, you want to select some objects (that have names) and have it add the same suffix to each name? What about objects that are selected that have no name?
For the first part â that´s quite right. I guess not that many people actually need it if I can´t find it anywhere, haha.
For the second part â that´s also quite right. Objects without a name may be singled out using _-Selname ââ (empty string) so for the purpouse of this âspecial requestâ they may be included, if that´s not a problem. But if that should prove difficult they may be left out.
In any case I thank you for your time
Itâs not difficult either way, simply that an object which has no name will end up with just the prefix or suffix as its name (i.e. 51-
or -51
), unless you want to automatically name âno-nameâ objects with something like Unnamed
+ prefix or suffix.
I´d just leave the prefix or suffix. Seems like it leaves the most possibilities open to work with souch objects afterwards. Especially if you can _-Selname â-51â nad add your own prefix like âunnamedâ afterwards.
OK, here are a couple to try out.
AddPrefixToObjName.py (697 Bytes)
AddSuffixToObjName.py (697 Bytes)
A perfect couple.
Thank you very much