Home General VB.NET Get Block Attributes .NET
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Get Block Attributes .NET PDF Print E-mail
User Rating: / 0
PoorBest 
Tutorials

The sample below show a code to access a blocks attributes using VB.NET

[code]

Private Sub GetBlockAttributes()

        Dim AcadApp As Object
        Dim dbxDoc As Object

        AcadApp = StartAutoCADSession()
        dbxDoc = AcadApp.Activedocument
        AcadApp.Visible = True

        Dim I As Integer
        Dim strAttributes As String
        Dim varAttributes As Object
        Dim entity As Object

        For Each entity In dbxDoc.PaperSpace

            If TypeName(entity) = "IAcadBlockReference" Then
                If entity.hasattributes = True Then

                    varAttributes = entity.GetAttributes
                    strAttributes = ""

                    For I = LBound(varAttributes) To UBound(varAttributes)

                        MsgBox("BLOCKNAME:  " & entity.name & vbCr _
                                & "TAG             :  " & varAttributes(I).TagString & vbCr _
                                & "VALUE         :  " & varAttributes(I).TextString)

                    Next
                End If
          End If

        Next entity

    End Sub

[/code]

Attachments:
FileDescriptionFile sizeDownloads
Download this file (GETBLOCKS.zip)GETBLOCKS.zip 12 Kb302
 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade