Message 1 of 3
Not applicable
01-21-2011
05:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All It is me again . Big Bugger.
I wanted user to be allowed to pick just one object when he/she prompted. The program should exit and do process. I searched and gile from this forum helped me. Now when I get that object from user. I can't access to "insertionpoint" and "getboudingbox" property of that object ( Exactly Where I made it RED) . Autocad Crashes. Other properties are good. like Layer , Rotation, TextString.
I need help here please . see the code. I am not expert with professional terminology please be simple. Thank you all for helping me to keep my job.
Thanks.
Sub Selectonscreen_one_item()
Dim myPEO As New Autodesk.AutoCAD.EditorInput.PromptEntityOptions(vbLf & "Select BarMark:")
Dim mydwg, mydb, myed, myent, myPS, myPer, mytrans, mytransman,MIND,MAXD 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
TempTTT = myent.textstring
TempTT = myent.Rotation
MIND = myent.insertionpoint()
myent.GetBoundingBox(MIND, MAXD)
Solved! Go to Solution.