I've looked through many posts and can't make this work. Using ACAD2010. I would appreciate any help.
Dim ac AsObject = Nothing
If ac IsNothingThen
ac = CreateObject(
ac = GetObject(,
Dim dbxDoc AsObject
dbxDoc = ac.Activedocument
Dim strAttributes As String
Dim varAttributes As Object
Dim entity As Object
ForEach entity In dbxDoc.ModelSpace
If TypeName(entity) = "AcDbBlockReference" Then
If entity.hasattributes = True Then
varAttributes = entity.GetAttributes
For i = LBound(varAttributes) ToUBound(varAttributes)
MsgBox("BLOCKNAME: "& entity.name & vbCr _
"TAG : "& varAttributes(i).TagString & vbCr _
"VALUE : "& varAttributes(i).TextString)
and where is the problem? (what line of code and what exception do you get)
I have'nt tried your code, but as long as I don't see where your problem is I also would not spent to much time in getting it into a sample-project to try it. Just looking to your code for few seconds I don't see a problem .... well except of that I would run with Option Strict ON so I couldn't do any type mismatches.
Additionally a drawing may help, that you use for testing. But as long as you have blockreferences with attributereferences in it .... ???
- alfred -
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!