TheSwamp

Code Red => VB(A) => Topic started by: fxcastil on September 07, 2015, 01:58:44 AM

Title: AutoCAD Version 2011 vs 2014 (reading block attributes)
Post by: fxcastil on September 07, 2015, 01:58:44 AM
I have been using the same VBA routines for reading Block Attributes but now it's not working in AutoCAD 2104 (32 bit)

The simplified code and problem area (I can read the block attribute tag names)

Dim VarArray as Variant

VarArray = objBlkRef.GetAttributes


For Count = LBound(VarArray) To UBound(VarArray)

            StrTag = VarArray(Count).TagString   ' I get an error here
                   
Next Count

I added the few lines below for testing and here are the results

If objBlkRef.HasAttributes Then MsgBox "I have attributes"   ' The message is printed so I know the block has attributes (but I already filter for blocks with attributes)

Msgbox LBound(VarArray)  ' returns a 0 as expected

Msgbox LBound(VarArray)  ' returns a 4 as expected for a block which has 5 attributes

Msgbox VarArray(1).TextString   ' returns and error

Msgbox VarArray(1).Textstring   ' returns and error


****************

I get the following error number and description

Error Number = 48
Error Description = Error Loading DLL   (not sure what DLL is not being loaded which is required for reading block attributes



Title: Re: AutoCAD Version 2011 vs 2014 (reading block attributes)
Post by: RICVBA on September 08, 2015, 01:17:36 AM
your code runs ok in my Autocad 2014
did you change your Autocad Type Library reference to address "Autocad 2014 Type Library"?
if not:
- go to Tools->References
- scroll the listbox to reach "Autocad 2014 Type Library" entry
- select it by marking its checkbox checked
- click ok