OFPEC Forum

Addons & Mods Depot => ArmA - O2 and Models/Modelling => Topic started by: h- on 08 Mar 2009, 23:02:47

Title: Selection naming script
Post by: h- on 08 Mar 2009, 23:02:47
Is it possible to write a O2 script that would automatically name multiple selected vertices by naming each with a incrementing number, like myselection_0, myselection_1,...myselection_n?
In case I'm confusing yous with my complete lack of terminology knowledge; I mean that if I for example add 200 'points' in the memory LOD I could name them with a script instead of doing it manually..

The scripting language confuses me completely due to lack of proper documentation (the O2 comref is not that helpfull) so I don't know if that's even remotely possible.  :dunno:
Title: Re: Selection naming script
Post by: Synide on 09 Mar 2009, 15:27:32
I think the commands your looking for are...

object forEachPoint [condition,operation,back]
sel selectPoint index
object save selection

... me thinks... possibly, oh heck, i dunno without doing it myself... maybe i'll give it a bash tomorrow...
Title: Re: Selection naming script
Post by: h- on 09 Mar 2009, 22:17:00
Thanks.  :good:

This whole thing wasn't as confusing as it originally seemed to be, but I'm not really getting anywhere..
Title: Re: Selection naming script
Post by: Synide on 09 Mar 2009, 23:02:08
...but I'm not really getting anywhere..

k, i'll have a play & see what i can come up with...


eidt:

ok... here ya go, try this...

Code: [Select]
_lod=getActiveObject this;
_lod forEachPoint [{true},{_name="Synide_" + str(_x);_sel=newSelection _lod;_sel selectPoint _x;_lod save (_sel as _name);}];

obviously you'd want to change it to have a selection name starting with 'blah_' and i'd only run it in a lod with a smallish number of points like a memory lod, you'd probably guess running it in a 1.0 lod with 10,000 points wouldn't be healthy...
Title: Re: Selection naming script
Post by: h- on 10 Mar 2009, 18:06:15
Brilliant, thanks! :clap:
Works like a charm.

When will I learn to keep it simple, I was going way too complex routes with this..  ::)