Hi @chrisw01a,
Okay here's a quick iLogic rule that creates a sketch on the top face of the flat pattern and then places holes on the ends of each bend (up and down).
I'd set this up as an external rule, although the attached 2017 file has it set up as an external rule.
I didn't test this much, so you're likely to run across some issues. If so post back.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'[ edit these variables as needed
sSketchName = "Flat Pattern Sketch"
sHoleName = "Locator Holes"
oOffset = 0.100 in'defines offset from edge of flat pattern
oDiameter = 0.125 in 'defines hole diameter
']
' a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
'verify document type is sheet metal
If oPartDoc.ComponentDefinition.Type <> 150995200 Then
MessageBox.Show("File is not a sheet metal part.", "iLogic")
Exit Sub
End If
Dim oCompDef As SheetMetalComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
' Check to make sure a flat pattern is open.
If Not TypeOf ThisApplication.ActiveEditObject Is FlatPattern Then
Try
If oCompDef.HasFlatPattern = False Then
oCompDef.Unfold
Else
oCompDef.FlatPattern.Edit
End If
Catch
MessageBox.Show("Error editting the flat pattern.", "iLogic")
End Try
End If
' a reference to the active flat pattern.
Dim oFlatPattern As FlatPattern
oFlatPattern = ThisApplication.ActiveEditObject
'clean up existing holes
Dim oHole As HoleFeature
For Each oHole In oFlatPattern.Features.HoleFeatures
oHole.Delete
Next
Dim oFace As Face
oFace = oFlatPattern.TopFace
Dim oSketch As PlanarSketch
'clean up existing sketch
For Each oSketch In oFlatPattern.Sketches
If oSketch.Name = sSketchName Then
oSketch.Delete
End If
Next
' Create a new sketch. The second argument specifies to include/not include
' the edges of the face in the sketch.
oSketch = oFlatPattern.Sketches.Add(oFace, False)
' Change the name.
oSketch.Name = sSketchName
' Create a new object collection for the hole center points.
oHoleCenters = ThisApplication.TransientObjects.CreateObjectCollection
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim oPoint As Point2d
Dim oEdge As Edge
oOffset = oOffset * 2.5400013716 'converts cm to inches
' Get all Bend UP edges on top face
Dim oTopFaceBendUpEdges As Edges
oTopFaceBendUpEdges = _
oFlatPattern.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendUpFlatPatternEdge, True)
For Each oEdge In oTopFaceBendUpEdges
oPoint = oTG.CreatePoint2d(oEdge.StartVertex.Point.x, oEdge.StartVertex.Point.Y - oOffset)
oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
oPoint = oTG.CreatePoint2d(oEdge.StopVertex.Point.x, oEdge.StopVertex.Point.Y + oOffset)
oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
Next
' Get all Bend DOWN edges on top face
Dim oTopFaceBendDownEdges As Edges
oTopFaceBendDownEdges = _
oFlatPattern.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendDownFlatPatternEdge, True)
For Each oEdge In oTopFaceBendDownEdges
oPoint = oTG.CreatePoint2d(oEdge.StartVertex.Point.x, oEdge.StartVertex.Point.Y - oOffset)
oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
oPoint = oTG.CreatePoint2d(oEdge.StopVertex.Point.x, oEdge.StopVertex.Point.Y + oOffset)
oHoleCenters.Add ( oSketch.SketchPoints.Add(oPoint, True))
Next
' Create the hole feature.
oHole = oFlatPattern.Features.HoleFeatures.AddDrilledByThroughAllExtent( _
oHoleCenters, oDiameter * 2.5400013716 , kPositiveExtentDirection)
oHole.Name = sHoleName
