Thanks Gile.
You were right . With your tip I was able to google it and find a good tweaked working code.
Thanks again from everybody in this discussion. I am learning here.
Sub test_editor_prompt()
Dim myPEO As New Autodesk.AutoCAD.EditorInput.PromptEntityOptions(vbLf & "Select BarMark:")
Dim mydwg, mydb, myed, myPS, myPer, myent, mytrans, mytransman As Object
mydwg = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
mydb = mydwg.Database
myed = mydwg.Editor
myPEO.SetRejectMessage("You must select a BarMark." & vbCrLf)
myPEO.AddAllowedClass(GetType(Autodesk.AutoCAD.DatabaseServices.DBText), False)
myPer = myed.GetEntity(myPEO)
myPS = myPer.Status
Select Case myPS
Case Autodesk.AutoCAD.EditorInput.PromptStatus.OK
'MsgBox("Good job!")
mytransman = mydwg.TransactionManager
mytrans = mytransman.StartTransaction
myent = myPer.ObjectId.GetObject(Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead)
'MsgBox("Entity is on layer " & myent.Layer)
'Where did he click?!
Case Autodesk.AutoCAD.EditorInput.PromptStatus.Cancel
MsgBox("You cancelled.")
Exit Sub
Case Autodesk.AutoCAD.EditorInput.PromptStatus.Error
MsgBox("Error warning.")
Exit Sub
Case Else
Exit Sub
End Select
End Sub