'
' This example demonstrates how to determine which edges are selected
' in the UI by using the SubComponent object via the Selection
'
NewScene , false
' Setup: create a polygon mesh and select some edges on it
set disc = Application.ActiveSceneRoot.AddGeometry( "Disc", "MeshSurface" )
Selection.Clear()
Selection.SetAsText( disc.Name & ".edge[113,115,117,119,121]" )
' When components are selected, the first member of the Selection
' is returned as a CollectionItem which can then be converted to a
' SubComponent object. From there, the ComponentCollection property
' converts it to the proper collection type (in this case an EdgeCollection)
set selected = Selection(0).SubComponent.ComponentCollection
for each sel in selected
Application.LogMessage "edge[" & sel.Index & "] is selected."
next
' Expected results:
'INFO : edge[113] is selected.
'INFO : edge[115] is selected.
'INFO : edge[117] is selected.
'INFO : edge[119] is selected.
'INFO : edge[121] is selected. |