.NET

Reply
Valued Contributor
muthineni
Posts: 73
Registered: ‎10-10-2011
Message 1 of 2 (151 Views)

Extracting block Attributes

151 Views, 1 Replies
01-08-2014 02:09 AM

I need to open a drawing and read block attributes in each layout.

 

 

 Dim AcadApp As AcadApplication
        Dim AcadDoc As AcadDocument

 Try
            AcadApp = GetObject(, "AutoCAD.Application")
        Catch ex As Exception
            AcadApp = CreateObject("AutoCAD.Application")

        End Try
        AcadApp.Visible = True
        Try
            AcadDoc = AcadApp.Documents.Open(DWGName, True)
            Me.Refresh()

        Catch ex As Exception
            Me.Refresh()
            Exit Function
        End Try

 

  Dim Obj As Object

 

 For Each Obj In AcadDoc.Layouts

'-----------------Till here i was able to do.-------------------------

next

 

can anyone help me on how to read each layout block attributes?

*Expert Elite*
Alfred.NESWADBA
Posts: 9,070
Registered: ‎06-29-2007
Message 2 of 2 (139 Views)

Re: Extracting block Attributes

01-08-2014 03:10 AM in reply to: muthineni

Hi,

 

>> how to read each layout block attributes?

a layout can have multiple blockreferences! So if you like to get all titleblocks I would preferre to create a selectionset using the blockname of your titleblocks and go through that selectionset.

 

Look to >>>this blog<<< for selectionsets by blockname

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.