Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the Block Reference name

Status
Not open for further replies.

tonioJ

Programmer
Oct 7, 2002
90
PH
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
 
hello borgunit,

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top