Finding Out What's Currently Selected

 
 
 

There is a difference between how you get the list of selected objects vs. components. Basically, you can access selected objects by treating the Selection or Selection object as a collection or array of currently selected objects, so you can enumerate over them or access them directly as an item in the collection/array (see Accessing the List of Selected Objects).

Note

You can also find out which selection filter is currently selected via the Selection or Selection object (see Getting the Current Selection Filter).

However, when components are selected, for C# and scripting you need to use the SubComponent interface to convert the selection to its relevant component collection (see Accessing the List of Selected Components via the Object Model). For the C++ API, it is more complicated, since the SubComponent class is not yet fully implemented, you need to use the CComAPIHandler to invoke the .NET/scripting implementation of SubComponent (see Accessing the List of Selected Components via the C++ API and Working with the Selection List as a CRefArray (C++ API only)).

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License