AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Reply
Active Contributor
kani_mca
Posts: 43
Registered: ‎02-07-2013
Message 1 of 1 (123 Views)

Attributes

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

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?

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
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.