.NET
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

How to find a Table of ModelSpace

1 REPLY 1
Reply
Message 1 of 2
Anonymous
250 Views, 1 Reply

How to find a Table of ModelSpace

 

Hello!!

 

I have created several Tables with;

   Dim td = new Table()

 

Now, i want to find a specific Table in ModelSpace but i donĀ“t know how to do.

 

I can search all object of type Table with next code; The problem is that i dont know how to diferenciate a Table with others Tables.  

 <CommandMethod("IterateTables")> _
  Public Sub IterateTables()
    Dim doc As Document = Application.DocumentManager.MdiActiveDocument
    Dim db As Database = doc.Database
    Dim ed As Editor = doc.Editor
    Dim objId As ObjectId = Nothing
    Dim i As Integer = 0

    Using tr As Transaction = doc.TransactionManager.StartTransaction
      Dim bt As BlockTable = DirectCast(tr.GetObject(doc.Database.BlockTableId, OpenMode.ForRead), BlockTable)
      Dim btr As BlockTableRecord = DirectCast(tr.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForRead), BlockTableRecord)

      For Each objId In btr
        If objId.ObjectClass.DxfName.ToUpper = "ACAD_TABLE" Then
          i += 1
          MsgBox("TABLE: " & i.ToString)
        End If
      Next
      tr.Commit()
    End Using

    doc = Nothing
    db = Nothing
    ed = Nothing
    objId = Nothing
  End Sub

 

 Can i set a name to a Table? or can i asociate attributes to aTable?

 

Thanks,

 

Ane

 

1 REPLY 1
Message 2 of 2
SENL1362
in reply to: Anonymous

What are the differences between the tables when looking at them. Is it position, layer, color or contents such as number of rows or columns or cell values. Do they have different titles or column headers. All these characteristics can be used in a search for the ONE you want.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

ā€Boost