Jump to content

AutoCAD VBA Getting attributes when in a class module


muck

Recommended Posts

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,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...