1 Reply Latest reply on Apr 12, 2017 8:28 PM by Raghvendra Bhargava

    How to adjust the row height and column width of BOM using macros?

    Marco Wu

      May I know how I can use macro to set the row height and column width of BOM?

      I want to set each row to be 0.25", but the column width will depend on the context of the column.

      Please help

      Thanks

        • Re: How to adjust the row height and column width of BOM using macros?
          Raghvendra Bhargava

          Select the BOM table and Try this:

           

          Dim swApp As Object

          Dim Part As ModelDoc2

          Dim boolstatus As Boolean

          Dim longstatus As Long, longwarnings As Long

           

          Sub main()

          Set swApp = Application.SldWorks

          Set Part = swApp.ActiveDoc

           

          Dim bomTbl As BomTableAnnotation

          Set bomTbl = Part.SelectionManager.GetSelectedObject6(1, -1)

           

          Part.ClearSelection2 True

           

          Dim TblAnn As TableAnnotation

          Set TblAnn = bomTbl

           

          Dim RowHt As Double

          RowHt = TblAnn.GetRowHeight(0)

           

          Dim retHt As Long

          retHt = TblAnn.SetRowHeight(swTableCellRange_All, 0.00635, 0)

           

          End Sub