XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : Objects in a layer

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 ??

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.

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".


oSel = Application.Selection(0);

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

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

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

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.