Public Sub HighlightEntity(ByVal ObjID As ObjectId, ByVal Hight As Boolean)
Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim trans As Transaction = db.TransactionManager.StartTransaction()
Using trans
Dim ent As Entity = CType(trans.GetObject(ObjID, OpenMode.ForWrite, False), Entity)
If Hight = True Then
ent.Highlight()
Else
ent.Unhighlight()
End If
trans.Commit()
End Using
End Sub