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.
Solved by WHassan. 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