Thanks for the reply..
I am unable to get the owner ID of the nested entity. Since, it hangs up at getting the object ID itself, it does not go till the point I am able to get the nested entity.
Please, find my whole code is as below:
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
While (True)
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
' Open the Block table record for read
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
'' Open the Block table record Model space for write
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
Application.SetSystemVariable("OSMODE", 512)
Dim acnsprompt As PromptPointResult = acDoc.Editor.GetPoint(vbCrLf & "Select APN or <exit>: ")
If acnsprompt.Status = PromptStatus.OK And Not IsNothing(acnsprompt.Value) Then
Dim pneo As PromptNestedEntityOptions
pneo =New PromptNestedEntityOptions("")
pneo.NonInteractivePickPoint = acnsprompt.Value
pneo.UseNonInteractivePickPoint =True
pneo.AllowNone =True
If acDoc.Editor.GetNestedEntity(pneo).ObjectId = ObjectId.Null Or Not IsNothing(acDoc.Editor.GetNestedEntity(pneo).ObjectId) Or Not IsDBNull(acDoc.Editor.GetNestedEntity(pneo).ObjectId) Then
Dim psubent As Entity = acTrans.GetObject(acDoc.Editor.GetNestedEntity(pneo).ObjectId,OpenMode.ForRead)
If psubent.GetRXClass.Name.ToString = "AcDbText" Then
If psubent.Layer.Contains("APN") Then
Dim txt As DBText = DirectCast(psubent, Entity)
End If
End If
psubent.Dispose()
End If
pneo =Nothing
end if
end using
end while