Autocad- get to the field edit value of a block attribute

Well, this was like looking for a needle in a haystack. I tried to use google to know if a block attribute referred to text or to a formula that made the text. The key is looking at the extension dictionary. If there is one, it has dictionaries inside of them and if one of the items in named “ACAD_FIELD” then… yes this attribute is de-referenced or aliased or abstracted by using a formula. I was usinging the attributes .Text property which gives you the RESULT of the field formula underneath. I was doing search and replaces and blowing away the formulas – which would have been best left alone. Now I can skip them.

The guy here about 8 posts down AFTER reading the code was my hero on this one. It was after about 20 google searches.

Here is the relevant code.

[vba]

Dim Xdictionary As AcadDictionary 
                Set Xdictionary = attObj.GetExtensionDictionary 
                Dim fldObject As Object 
                On Error Resume Next 
                 ' check if attribute has field
                Set fldObject = Xdictionary.GetObject("ACAD_FIELD") 
                If Err.Number <> 0 Then 
                    Err.Clear 
                    If fldObject Is Nothing Then 
                        Exit Sub 
                    End If 
                End If 
                 
                 'get attribute Handle property 
                attHandle = attObj.handle 
                Debug.Print attHandle 

[/vba]

This item, if you then keep digging will eventually lead us to the formula underneath.