Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Editing via macro? 3

Status
Not open for further replies.

jagodragon

Automotive
Mar 2, 2009
61
0
0
US
I need to create a rev table using a macro. I've seen a few Rev tools and BOM tools that can modify tables and i think it makes for a better list that is more easily modified. but i have not ssen the code for those. All the ones i have found will draw the lines and insert text boxes. for the time being i am going to use this method. But, if any one can give me some code for tables that i can work with It would be greatly appreciated.
 
Replies continue below

Recommended for you

Hi

Create a drawing table

Code:
Sub CATMain()
    '-----------------------
    ' ACCESS DRAWING
    '----------------------
    ' retrieve drawing document infrastructure
    Dim DrwDoc As DrawingDocument
    Set DrwDoc = CATIA.ActiveDocument

    Dim shActiveSheet As DrawingSheet
    Set shActiveSheet = DrwDoc.Sheets.ActiveSheet

    Dim vwActiveView As DrawingView
    Set vwActiveView = shActiveSheet.Views.ActiveView
    '------------------
    ' CREATE TABLE
    '-----------------
    ' table position: 350, 150
    ' number of rows equal to 10
    ' number of columns: 4
    ' row height: 20
    ' column width: 50
    Dim tblTable As DrawingTable
    Set tblTable = vwActiveView.Tables.Add(350, 150, 10, 4, 20, 50)

    ' set table caption
    tblTable.SetCellString 1, 2, "X"
    tblTable.SetCellString 1, 3, "Y"
    tblTable.SetCellString 1, 4, "Z"
    
    End Sub

Regards
Fernando

 
Status
Not open for further replies.
Back
Top