Can't access "Getboundingbox" and "insertionpoint" property of DBTEXT

Can't access "Getboundingbox" and "insertionpoint" property of DBTEXT

Anonymous
Not applicable
728 Views
2 Replies
Message 1 of 3

Can't access "Getboundingbox" and "insertionpoint" property of DBTEXT

Anonymous
Not applicable

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)

 

 

 

0 Likes
Accepted solutions (1)
729 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Names have changed from VBA

 

For insertionpoint - try Position

For Getboundingbox - try GeometricExtents for Entity

                          or GeometricExtentsBestFit for BlockReference

0 Likes
Message 3 of 3

Anonymous
Not applicable

 

Thank you so much mohnston . You solved my problem big time. God Bless you.

I love you guys here

0 Likes