PDA

View Full Version : Objects in a layer


varunbondwal
08-19-2008, 02:39 PM
I need to get a list of objects in the selected layer through scripting... does anyone have an idea how it may be done, whether in Jscript or VBscript or python ??

PureMoxi
08-24-2008, 11:13 PM
It might help if you say how you intend to use the list/data. If it is merely for quick visual feedback that is one thing...if it is to make the objects available to undergo some further manipulation or be the subject of additional scripting, then that might require a different answer.

tc
08-25-2008, 01:04 AM
Select the layer, ctrl+shift+4, it will pop the SDK explorer.
You will see that the layer object has a Nested Object called "Members".

example:


//Jscript
oSel = Application.Selection(0);

if(ClassName(oSel) == "Layer")
{
oMembers = oSel.Members;
LogMessage( "Layer " + oSel + " has " + oMembers.count + " members." )
LogMessage( " ---> " + oMembers.GetAsText() );
}
else
{
LogMessage("Selected Object is not a Layer");
}

PureMoxi
08-25-2008, 11:12 PM
did not know that one...very cool..thx tc.

varunbondwal
08-29-2008, 03:43 AM
Heyy.. thnx tc.. that helped a lot

ThE_JacO
08-29-2008, 12:49 PM
There's a programming subforum.
Please use it :)

Moving this thread there for you.

CGTalk Moderation
08-29-2008, 12:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.