AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Active Contributor
43 Posts
0 Kudos
Registered: ‎02-07-2013
Post 1 of 1


125 Views, 0 Replies
02-12-2013 11:53 PM

I want to know how to get attributes from Currently opened drawing using

 Dim blkobj As AcadBlockReference
        Dim attributeName1 As String = String.Empty
        Dim attributeValue1 As String = String.Empty

            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
        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?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.