Hide Table of Contents
SetRowHeight Method (ITableAnnotation)

Sets the height of the specified row in this table.

.NET Syntax

Visual Basic (Declaration) 
Function SetRowHeight( _
   ByVal Index As System.Integer, _
   ByVal Height As System.Double, _
   ByVal Options As System.Integer _
) As System.Double
Visual Basic (Usage) 
Dim instance As ITableAnnotation
Dim Index As System.Integer
Dim Height As System.Double
Dim Options As System.Integer
Dim value As System.Double
value = instance.SetRowHeight(Index, Height, Options)
System.double SetRowHeight( 
   System.int Index,
   System.double Height,
   System.int Options
System.double SetRowHeight( 
&   System.int Index,
&   System.double Height,
&   System.int Options


Index of row for which to set height
Height at which to set specified row,  in system units
Table's behavior after changing row as defined by  swTableRowColSizeChangeBehavior_e (see Remarks)

Return Value

Height to which specified row is set (see Remarks)


The index for both rows and columns is 0-based.

Index is the number of the row whose height to set. The first row is row 0.  It can also be a value from the swTableCellRangeIdentifier_e enumerator.

If Index equals...

Then the height of all of the rows...


Is set, if possible.


In the current range (see ITableAnnotation::GetCellRange and ITableAnnotation::SetCellRange) is set, if possible

When the height of a row changes, the rest of the table is affected. The Options argument indicates  the rest of the table's behavior.



Options = swTableRowColChange_TableSizeCanChange

The rest of the rows remain the same height and are shifted away from the table anchor to make room for the changed row.

Height of the entire table must remain the same, so that the table continues to fit properly on the drawing

Other rows must absorb the change in height. There are two possibilities supported by this method.

  • If Options = swTableRowColChange_AbsorbedByNext, then first row below the rows whose height has changed, are adjusted if possible.  If that is not possible, then the first row above the rows whose height has changed, is adjusted if possible. If that is not possible either, then no action is taken.  

  • The other similar case is if Options = swTableRowColChange_AbsorbedByPrevious. First the row above is tried, then the row below.

Options = swTableRowColChange_AbsorbedByNext or swTableRowColChange_AbsorbedByPrevious

It may not be possible to get the desired results. If this is the case, then you must determine the full height of the table yourself and set row heights individually using the swTableRowColChange_TableSizeCanChange option, making sure to end up with the original  table height.

The return value is the height at which the row is set. If you specified a range of rows, it is the height of the first row of that range.

It is possible that the return value is different than the height value that you passed in. One possibility is that if you specify a row height that is less than the minimum row height, the minimum row height is used, instead of what you specified. Another possibility is that if you are trying to maintain a fixed table height, but the height of the adjacent rows is not big enough to absorb the height changes to the rows that you specified, then the return value is the same as the row's original width instead of what you specified.

To get the row height, use ITableAnnotation::GetRowHeight.

To get or set the column width, use ITableAnnotation::GetColumnWidth and ITableAnnotation::SetColumnWidth.


See Also


SolidWorks 2004 FCS, Revision Number 12.0

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   SetRowHeight Method (ITableAnnotation)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2013 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.