vb.net如何通过实体得到其所属的组的名字
vb.net如何通过实体得到其所属的组的名字求大侠指点 Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim PromptResult As PromptEntityResult = doc.Editor.GetEntity("选择对象")
If PromptResult.Status <> PromptStatus.OK Then
Exit Sub
End If
Using doc.LockDocument
Using Trans As Transaction = doc.TransactionManager.StartTransaction
Dim SelectedEnt As Entity = Trans.GetObject(PromptResult.ObjectId, OpenMode.ForRead)
Dim GroupDict As DBDictionary = Trans.GetObject(doc.Database.GroupDictionaryId, OpenMode.ForRead)
For Each GroupEnt As DBDictionaryEntry In GroupDict
Dim Grp As Group = Trans.GetObject(GroupDict(GroupEnt.Key), OpenMode.ForRead)
If Grp.Has(SelectedEnt) Then
MsgBox(Grp.Name) '通过此处来判断
End If
Next
Trans.Abort()
End Using
End Using
页:
[1]