Hi,
I have a macro to create drawings for all sheet-metal parts in an assembly.
Each drawing has a single view of the flat pattern and a bend table for the same view i.e.
'Create the view
objDrawingView = objDrawingSheet.DrawingViews.AddBaseView(objMyPartDocument, objMyPoint2D, dblMyViewScale, _ ViewOrientationTypeEnum.kFlatPivotLeftViewOrientation, _ DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, , , objMyNameSpace)
'Create the bend table
objBendTable = objDrawingSheet.CustomTables.AddBendTable(oMyPartDocument.FullFileName, objMy2ndPoint2D, _ "Bend Table", strBendTableColumns, True, "BEND - ")
' where strBendTableColumns = {"BEND ID", "BEND DIRECTION", "BEND ANGLE"}
Now I want to add tags for the bends to the unfolded view of my part. Doing this manually is by right-clicking on the bend table and selecting the option "Add Tags to View" and then clicking on the view (of the flat pattern) But can I get some help to do this through the same macro??
Thanking you,
Wajih
Solved! Go to Solution.
I was trying to do the same, and this post saved me hours.
FYI (and in a tidier format), the important bits of code are:
oDrawingDocument.SelectSet.Clear()
oDrawingDocument.SelectSet.Select(oBendTable)
oDrawingDocument.SelectSet.Select(oView1)
m_inventorApplication.CommandManager.ControlDefinitions("DrawingTableSelectBendViewCtxCmd").Execute()
where oBendTable is a custom table (bend table)
oView1 is the drawing view
m_inventorApplication is the running application
It might be a bit messy but it works
Thank you
Joe
Hi @Maxim-CADman77 - yes, CustomTable.AddBendTagsToView was added in Inventor 2025. Here is sample code:
Dim drawDoc As DrawingDocument = ThisDrawing.Document
Dim sheetX = drawDoc.ActiveSheet
Dim tables = sheetX.CustomTables
Dim modelDoc = ThisDrawing.ModelDocument
Dim filename = modelDoc.FullFileName
Dim tablePt = ThisApplication.TransientGeometry.CreatePoint2d(30, 20)
Dim newTable = tables.AddBendTableWithOptions(filename, tablePt)
Dim view1 = sheetX.DrawingViews(1)
newTable.AddBendTagsToView(view1)
Can't find what you're looking for? Ask the community or share your knowledge.