I'm not good at transforms - and I'm making an assumption using the "Get Transform for Each Circular Pattern Instance" example.
With that example code I want to expand on it and locate all the instances in the circular pattern. Here is what I have so far.
It is inserting the right number of points (to represent the location of the holes), but the location is not correct. Thank you for your help.
<p> Dim swCirPatternData As SldWorks.CircularPatternFeatureData</p><p> Dim swMathTransform As SldWorks.MathTransform</p><p> </p><p> Set swApp = Application.SldWorks</p><p> Set swModel = swApp.ActiveDoc</p><p> Set swSelMgr = swModel.SelectionManager</p><p> </p><p> boolstatus = swModel.Extension.SelectByID2("CirPattern1", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, swSelectOptionDefault)</p><p> Set swFeat = swSelMgr.GetSelectedObject5(1)</p><p> </p><p> Set swCirPatternData = swFeat.GetDefinition</p><p> </p><p> ' Get the transform for each instance</p><p> ' in the circular-pattern feature</p><p> Dim NbrInstances As Long</p><p> NbrInstances = swCirPatternData.TotalInstances</p><p> swModel.Insert3DSketch2 False</p><p> For i = 0 To (NbrInstances - 1)</p><p> Debug.Print " Processing instance... " & (i + 1)</p><p> Set swMathTransform = swCirPatternData.GetTransform(i)</p><p> Debug.Print "Pattern Instances: (" & -1# * swMathTransform.ArrayData(0) * 1000# & ", " _</p><p> & -1# * swMathTransform.ArrayData(1) * 1000# & ", " _</p><p> & -1# * swMathTransform.ArrayData(2) * 1000# & ") mm"</p><p> swModel.SetAddToDB True</p><p> Set swIntSkPt = swModel.CreatePoint2(swMathTransform.ArrayData(0), swMathTransform.ArrayData(1), swMathTransform.ArrayData(2))</p><p> swModel.SetAddToDB False</p><p> Next</p><p> swModel.Insert3DSketch2 True</p>SolidworksApi macros