Author Topic: aadtable  (Read 2288 times)

0 Members and 1 Guest are viewing this topic.

Humbertogo

  • Guest
aadtable
« on: December 07, 2007, 05:50:52 AM »
I'm wondering if is possible to aadtable
as next 4 rows with the last one have 4 columns

Fatty

  • Guest
Re: aadtable
« Reply #1 on: December 07, 2007, 10:52:21 AM »
Take a look at MergeCells method in the Help file
Here is my old one I don't remember how it worked

Code: [Select]
Sub Merge_Cells()

    Dim oSpace As AcadBlock
    Set oSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim oTable As AcadTable
    Set oTable = oSpace.AddTable(pt, 4, 4, 1, 7)
    ZoomExtents

    Dim i As Long, j As Long

    oTable.TitleSuppressed = True
    oTable.HeaderSuppressed = True

    For i = 0 To oTable.Rows - 1
        For j = 0 To oTable.Columns - 1
            oTable.SetCellType i, j, acTextCell
            oTable.SetCellTextHeight i, j, 0.4
            oTable.SetCellAlignment i, j, acMiddleCenter
            oTable.SetText i, j, "Row " & CStr(i) & ": Column 0"

        Next j
    Next i

    For i = 1 To oTable.Rows - 2
    oTable.MergeCells i, i, 0, 3
    Next
    For i = 0 To oTable.Columns - 1
    oTable.SetText oTable.Rows - 1, i, "Row " & CStr(oTable.Rows - 1) & ": Column " & CStr(i)
    Next

    oTable.RecomputeTableBlock True
    oTable.Update
   
End Sub

~'J'~

Humbertogo

  • Guest
Re: aadtable
« Reply #2 on: December 08, 2007, 07:58:23 AM »
thank you exact what i need
just a modification and it will working fine

 For i = 0 To oTable.Rows - 2

Fatty

  • Guest
Re: aadtable
« Reply #3 on: December 09, 2007, 04:47:22 AM »
In case if your table style haven't
title as I guess
Isn't it?

~'J'~