Message 1 of 12
Select all in model space
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How do I select all without a filter and iterate through all that has been selected in VB.Net?
Using this code generate an error at the ed.SelectAll() line
Try
Dim Res As PromptSelectionResult = ed.SelectAll()
If (Res.Status = PromptStatus.OK) Then
Dim selectedIds As ObjectId() = Res.Value.GetObjectIds()
Using lk As DocumentLock = doc.LockDocument()
Using tr As Transaction = db.TransactionManager.StartTransaction()
For j = 0 To selectedIds.Count - 1
Dim ent As Entity = DirectCast(GetObjectbyID(selectedIds(j)), Entity)
ent.UpgradeOpen()
ent.ColorIndex = 8
ent.DowngradeOpen()
Next
tr.Commit()
End Using
End Using
End If
Catch ex As Exception
End Try