Trying to grab cluster name from a group

Discussions concerning programming of SOFTIMAGE©
Post Reply
User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 09:28

Trying to grab cluster name from a group

Post by Pete » 27 May 2013, 03:25

Hi there,
I'm trying to make a script that goes through a group of clusters and renames them, but I can't seem to access their names...

Image

Code: Select all

SelectMembers("Clusters", null, null);//select group
var oColl = new ActiveXObject("XSI.Collection") ;//create a collection
oColl.AddItems(Selection);//add group members to selection

for ( var i = 0; i < oColl.Count ; i++ )
{	
	SelectMembers(oColl[i],null,null);
	Logmessage(oColl[i]);
}
I would have thought the "logmessage" would have returned the clusters name but it returns nothing?

Image

Could someone help me out here?
Thanks
Pete

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: Trying to grab cluster name from a group

Post by csaez » 27 May 2013, 08:00

Try using the 'object model' instead :)

Code: Select all

var oGrp = Dictionary.GetObject("Clusters");
for(var i = 0; i < oGrp.Members.Count; i++) {   
   LogMessage(oGrp.Members(i).FullName);
}

User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 09:28

Re: Trying to grab cluster name from a group

Post by Pete » 28 May 2013, 02:44

That works great!
Thanks!

P.

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests