Thursday, 17 August 2017

Remove Columns on Bend Table

                Some Inventor tables are hard-coded and you can’t configure and preset their format. One of this tables is Bend Table and I had an interesting request from someone to remove Bend Radius column from it.





                You can customize it when you place the table or by editing the table, however, he doesn’t want to do it for every single table he places but rather configure it once and for all.




                This is one hard-coded table which can’t be configured. I have even searched the registry to see if I can find any reference and couldn’t find any. 


                Case has been confirmed by Autodesk QA Engineers but that doesn’t mean we can’t speedup the process.

                I have written an ilogic code for you that will remove the bend radius from your table. I suggest you have this as an external rule which you can trigger with a nice form.....

Here's an example.




Here’s what the code does



And here is the code.


' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

'Declare my custom table
Dim oCustomTable As CustomTable

'Set name for this table
Dim TableName As String
TableName = "TABLE"

' Process the rule, wrapping it in a transaction so the
' entire process can be undone with a single undo operation.
Dim trans As Transaction
trans = ThisApplication.TransactionManager.StartTransaction( _
        oDrawDoc, "Remove Bend Radius column from Bend Table")

For i = 1 To oSheet.CustomTables.Count
    If oSheet.CustomTables.Item(i).Title = TableName Then
        TableNr = i
    Else
        MessageBox.Show("Table named: " & TableName & " was not found on drawing", "Missing Table")
        Exit Sub
    End If
Next

'declare the table to edit by the number found in check
oCustomTable = oSheet.CustomTables.Item(TableNr)

'remove Bend Radius column
oCustomTable.Columns.Item("Bend Radius").Delete()

'end transaction for single undo
trans.End

Later,

ADS


photo credit: Lex Photographic Black and White Columns and Arches (license)

No comments:

Post a Comment