Select all entities in a particular layer?
Posted: 14 Feb 2008, 20:00
I would like to be able to identify all entities in a layer once any entity in that layer is selected.
I've tried:
Any ideas? Thanks very much!
I've tried:
Code: Select all
Dim Selected As SortedList = CADImage.SelectedEntities
Dim tmpKey As String
Dim Line As CADImport.CADEntity
For Each tmpKey In Selected.Keys
Line = Selected(tmpKey)
'For i As Integer = 0 To Line.Layer.Entities.AllValues.Length - 1
'Dim cadent As CADEntity = Line.Layer.Entities(i)
'cadent.Selected = True
'Next
'the above For generated an exception because Line.Layer.Entities was nothing.
Next
If Line Is Nothing Then Exit Sub
CADImage.AddEntityToSelectCollection(Line.Layer)
CADImage.DoSelectEntity(Line.Layer)
DWT.CAD.InvalidateImage()
CADImage.InvalidateSelectedEntities(CADPict.CreateGraphics)