Hi,
I logged a ticket with ETO Engineering:
"Need a way to create a centerline for a pattern of features"
Perhaps using the Inventor API could provide a way. Here is a VBA example I have. I believe it does what you are asking about. (note that it would need to be updated to work with your Inventor files)
Sub test_AddCenteredPattern()
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim objColl As ObjectCollection
Set objColl = ThisApplication.TransientObjects.CreateObjectCollection()
Dim oCurveEnum As DrawingCurvesEnumerator
Dim oIntent As GeometryIntent
Dim oIptDoc As PartDocument
Set oIptDoc = oDrawDoc.ReferencedDocuments.Item(1)
Set oCurveEnum = oDrawDoc.ActiveSheet.DrawingViews.Item(1).DrawingCurves(oIptDoc.ComponentDefinition.Features("Drilled_Hole 1"))
Dim oCenterPts As ObjectCollection
Set oCenterPts = ThisApplication.TransientObjects.CreateObjectCollection()
Dim oCenterPt As Point2d
Dim bValidPt As Boolean
Dim i As Integer
For i = 1 To oCurveEnum.Count
If oCurveEnum.Item(i).CurveType = CurveTypeEnum.kCircularArcCurve Then
bValidPt = True
Set oCenterPt = oCurveEnum.Item(i).CenterPoint
Dim j As Integer
' Dont use duplicate center points
For j = 1 To oCenterPts.Count
If oCenterPt.IsEqualTo(oCenterPts.Item(j)) Then
bValidPt = False
Exit For
End If
Next j
If bValidPt Then
Call oCenterPts.Add(oCenterPt)
Set oIntent = oDrawDoc.ActiveSheet.CreateGeometryIntent(oCurveEnum.Item(i), Nothing)
Call objColl.Add(oIntent)
oCurveEnum.Item(i).color = ThisApplication.TransientObjects.CreateColor(0, 0, 0)
End If
End If
Next i
Set oCurveEnum = oDrawDoc.ActiveSheet.DrawingViews.Item(1).DrawingCurves(oIptDoc.ComponentDefinition.Features("Center_Hole"))
Set oIntent = oDrawDoc.ActiveSheet.CreateGeometryIntent(oCurveEnum.Item(1), Nothing)
Dim oCenterline As Centerline
Set oCenterline = oDrawDoc.ActiveSheet.Centerlines.AddCenteredPattern(oIntent, objColl, , , True)
End Sub
Thanks,
Wayne
Wayne Brill
Developer Technical Services
Autodesk Developer Network