I want to know how to get attributes from Currently opened drawing using vb.net?
Dim blkobj As AcadBlockReference
Dim attributeName1 As String = String.Empty
Dim attributeValue1 As String = String.Empty
Try
For Each obj As Object In blkobj.GetAttributes()
If attributeName1.ToUpper() = blkobj.EffectiveName.ToUpper() Then
'For reading AttributeValue
attributeValue1 = obj.TextString
'For Writing Attribute Value
obj.TextString = attributeValue1
End If
Next
blkobj.Update()
Catch
End Try
I used the above code..Iam getting null reference error in FOR EACH..I am using autocad electrical...
Please send me a solution..How to get attributes?