muck
19th Apr 2011, 06:20 pm
Program, AutoCAD 2010 VBA
I normally use the following code to get attributes from a drawing.
Public Sub array1Initialize()
For Each elem In ThisDrawing.ModelSpace
If elem.EntityName = "AcDbBlockReference" Then
If elem.Name = "SPREAD SHEET INFO" Then
array1 = elem.GetAttributes
DrawingAttributeCT = 0
For j = 0 To UBound(array1)
'Debug.Print array1(k)
DrawingAttributeCT = DrawingAttributeCT + 1
Next j
End If
End If
Next
End Sub
The attributes are in an array called array1. This works in my form module but when I move it to a class module I get array1 is not readable. Anyone have any ideal why this happens and is there any sample
code that gets attribute in a class module?
Thank you,
I normally use the following code to get attributes from a drawing.
Public Sub array1Initialize()
For Each elem In ThisDrawing.ModelSpace
If elem.EntityName = "AcDbBlockReference" Then
If elem.Name = "SPREAD SHEET INFO" Then
array1 = elem.GetAttributes
DrawingAttributeCT = 0
For j = 0 To UBound(array1)
'Debug.Print array1(k)
DrawingAttributeCT = DrawingAttributeCT + 1
Next j
End If
End If
Next
End Sub
The attributes are in an array called array1. This works in my form module but when I move it to a class module I get array1 is not readable. Anyone have any ideal why this happens and is there any sample
code that gets attribute in a class module?
Thank you,