Sketch a 1 meter construction circle centered on the origin.Sketch a 0.1 meter vertical line and constrain its midpoint to thecircle. Create a macro with the following code:
Select the line and run the macro. On my two machines, I get threepattern instances as expected, but the spacing is incorrect (117.64degrees instead of 120). Change the number of pattern instances toanything you like and the angle will be incorrect, with theexception of 2 patterm instances, which are 180 degrees apart asexpected.
A sample set of delta data:
instance count resultant error
3 2.36
4 5.71
5 1.61
6 4.72
7 3.17
8 3.78
360 0.09
720 0.05
1440 0.02
2880 0.015
Create the same pattern using the user interface and all is well.
Software shouldn't behave like this.
SolidworksApi macros
'-----------------------------------
Dim swApp As Object
Dim Part As ModelDoc2
Dim boolstatus As Boolean
Const PI = 3.14159265358979
Dim arcAngle As Double
Dim spacing As Double
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
arcAngle = 3 * PI / 2
spacing = 2 * PI
boolstatus = Part.CreateCircularSketchStepAndRepeat(0.5, arcAngle,3, spacing, False, "")
End Sub
'-----------------------------------
Select the line and run the macro. On my two machines, I get threepattern instances as expected, but the spacing is incorrect (117.64degrees instead of 120). Change the number of pattern instances toanything you like and the angle will be incorrect, with theexception of 2 patterm instances, which are 180 degrees apart asexpected.
A sample set of delta data:
instance count resultant error
3 2.36
4 5.71
5 1.61
6 4.72
7 3.17
8 3.78
360 0.09
720 0.05
1440 0.02
2880 0.015
Create the same pattern using the user interface and all is well.
Software shouldn't behave like this.
SolidworksApi macros
