Tables, strange row height

How is the row height calculated when inserting tables?
In the other CAD I never had problems in defining a table style and inserting a table. With BCAD I can't insert a good table with small values (like to be placed in a drawing with unit meters). Help doesn't help at all.
I attach a drawing with the table style and 2 tables, one coming from the other cad and the other from BCAD.

Comments

  • Hi João,

    I am by no means an expert, however I had a look at your file and the Styles all look to be set up fine.

    When I insert a table in your drawing, it looks like BricsCAD defaults the row height to whatever you last used, in any drawing. That is, if I inserted a table into my own drawing and specified the cell height & width, the next table I create in your drawing has the same properties. This appears to be regardless of what text height / margins you have set in Styles. I am unsure if this is something that can be set somewhere, maybe someone smarter than me can answer that.

    Interestingly, the first table I inserted today defaulted to cell height of 1, so at some point it must 'forget' the previously used dimensions and instead go back to 1.

    What I would suggest is:
    a) search the cad forums to see if some smart cookie has already made a lisp to autofill the cell sizes (this only really helps if you always use the same size tables), or
    b) insert your tables into paper space instead to use larger values.

    Unfortunately otherwise it looks like you just have to remember to manually change the cell height every time.

    I hope this was even a little helpful :)
  • ALANH
    edited September 2023
    One way to get around this is to make a custom table style on the fly there is so many variables involved in a table, so creating a new style forces it to match your criteria. At least 9 table settings most are not exposed in the table dcl. This is based on a text height. Using the new table style using lisp can set each column width to suit as well. The example has header cell bigger than data cells.



    I have started going down this path as every public request wants a different table look and feel. One has images and linetypes in cells.


  • A quick search showed that AudoCAD has the same issue to some extent, there are lisp routines to change the row height but those are basically a repeat manual edit of each row but then automated to some extent.

    The interesting thing is that BOM tables have the option to fix the row height through the BOM manager, so I was expecting this to be possible with regular tables as well, but alas no such luck. You may want to file a support/feature request to make this become available for regular tables as well.
    Perhaps there is a lisp command that could take care of this but I have no idea what that could be.

    One suggestion I found was to select all cells and then set the row height to e.g. 0.1 or 1 (i.e. smaller than your text size) and that should "force" to cell height to adjust to the lowest possible row height given the cell contents.
  • I just did a test.... if you insert a table by using insert table with fixed columns and rows the row height is incorrect with regard to the table style.

    However... if you use draw the table for creating one and you draw for the number of columns then the row height is like the upper table in your example.

    This seems like a bug to me or if it is working as designed then the design should be updated to fix this issue/inconsistency.
  • Using (setq objtable (vla-addtable vgms sp numrows numcolumns rowheight colwidth))
    I tried the set table default for rowheight to 1 and yes setting the rowheight to greater than that plus the 2xmargin works. Tried 5 & 8 etc.

    And this is a variation on that
    ;; Set the text height for the Title, Header and Data rows
    (vla-SetTextHeight custObj acDataRow txtht)
    (vla-SetTextHeight custObj acHeaderRow (* txtht 1.2))
    (vla-SetTextHeight custObj acTitleRow (* txtht 1.5))
  • Hi Alanh, RSW
    Thanks for inputs. Tables are far from perfect in AutoCAD, but when you are teaching important clients that moved to BricsCAD, these problems seemed bugs that must be solved ASAP. I'll keep Alanh workarounds but can't teach it to regular users, obviously.