Bend Table Creation

Bend Table Creation

Raider_71
Collaborator Collaborator
545 Views
2 Replies
Message 1 of 3

Bend Table Creation

Raider_71
Collaborator
Collaborator

I just want to confirm if the new "CustomTables.AddBendTableWithOptions" method in Inventor 2022 also does not automatically add the Bend Id's on the view. Is this correct?

 

Inventor 2021 and before the same was the case with the "CustomTables.AddBendTable" method.

 

So the only way to display the Bend Id's on the view after a Bend Table was created with the API is to use the Command Manager?

 

I was so excited when I saw the new Bend Table method in the 2022 API but then just to see it still does not add the Id's on the view... 🙁

0 Likes
546 Views
2 Replies
Replies (2)
Message 2 of 3

wgraham
Advocate
Advocate

This one is intriguing based on some odd behaviors encountered in my coding.  Try something similar to the following to get the bend ids.  Extracted the majority of the code from the default help menu.  The async execution of the "DrawingTableSelectBendViewCtxCmd"  to allow selection of the appropriate view is key.

 

Public Sub CreateBendTable()
' Set a reference to the active drawing document
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument

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

' Create the placement point for the table
Dim oPoint As Point2d
Set oPoint = ThisApplication.TransientGeometry.CreatePoint2d(25, 25)

' Specify the columns - this can be specified in any combination/order
Dim strColumns(1 To 5) As String
strColumns(1) = "BEND ID"
strColumns(2) = "BEND RADIUS"
strColumns(3) = "BEND ANGLE"
strColumns(4) = "BEND KFACTOR"
strColumns(5) = "BEND DIRECTION"

' Create the bend table by specifying the source sheet metal file
Dim oBendTable As CustomTable

Set oBendTable = oActiveSheet.CustomTables.AddBendTable("C:\myfilepath\SheetMetal.ipt", oPoint, "Bend Table", strColumns)

Call oDrawDoc.SelectSet.Select(oBendTable)
Call ThisApplication.CommandManager.ControlDefinitions("DrawingTableSelectBendViewCtxCmd").Execute2(False)
Call ThisApplication.CommandManager.DoSelect(oActiveSheet.DrawingViews(1))

End Sub

0 Likes
Message 3 of 3

Raider_71
Collaborator
Collaborator

Hi @wgraham 

 

Yes thats exactly what I am doing right now. I was hoping that the bend id's would automatically be inserted on the view when the Bend Table is created though. Having to use command manager is not ideal.

 

Anyways thanks for confirming that this is still the workflow to use when creating Bend Tables.

0 Likes