I am new to autoCAD 2002 programming using VBA. Using VBA for AutoCAD, how do I Get the Block Reference Name of the object when I double click it. Please provide me a sample code if possible. Thank you.
This doesn't double click but returns a name when selected:
Sub GetBlkName()
Dim acObj As AcadObject
Dim vbasePnt As Variant
ThisDrawing.Utility.GetEntity acObj, vbasePnt, "Select Block"
If acObj.ObjectName = "AcDbBlockReference" Then
MsgBox "This block is named " & acObj.Name
Else
MsgBox "This is not a block reference"
End If
End Sub
thanks for the reply. it worked. how do you make make the macro run continously through out the session of autocad. thanks you very much! it helped a lot.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.