Dear all
I am develop a great programe, So far, Almost all of the difficulties are overcome.
The last one bothers me is rotatecomponent in assembly.
like the bellow pic. this is assembly file. if I want to let the "motor" rotate about axis_y certain angle,
what' s the best way?
I used to use mate, this method can achieve the purpose, But I have to pre-defined axis and the plane for part,This is too much trouble
Then I use dragoperator, this method has a big problem, afterI drag, I can't read the data how much angle the part rotate about the axis.
SO I use mathtransforms. through this method, I can easily calculate X,Y,Z cooridinate value after the part rotate about the axis certain angle.
the only puzzle is :how to calculate another date. like bellow.
Dim swMathUtil As SldWorks.MathUtility
Dim swModel As SldWorks.ModelDoc2
Dim swXform As SldWorks.MathTransform
Dim i As Long
Dim bRet As Boolean
Set swMathUtil = swApp.GetMathUtility
Set swModel = swApp.ActiveDoc
Dim arr(15) As Double
Dim vXform1 As Variant
arr(0) = 1: arr(1) =A: arr(2) = 0
arr(3) = 0: arr(4) = 1: arr(5) = B
arr(6) = C: arr(7) = 0#: arr(8) =1
'the puzzle is how to calculate value A,B,C after the part rotate around the axis_y 30 degree(for example)
arr(9) = X: arr(10) = Y: arr(11) = Z
'9 to 11 represent X,Y,Z after the part rotate about axis
arr(12) = 1#
' No used so pad with zeros
arr(13) = 0: arr(14) = 0: arr(15) = 0
vXform1 = arr
Set swXform = swMathUtil.CreateTransform(vXform1) ' create unit transform
swComp.Transform2 = swXform
can you tell me how to calculate value arr(1) to arr(8) ,after the part rotate 30° about AXIS_Y for example?
any suggestion will be appreciated
zhengjun ,
shanghai,china
SolidworksApi macros
