Hello @GeorgK,
i'm not sure if it this what you're looking for.. but here is a inventor-rule i have used to write angles into components (which are always disabled in the iproperties)
run the rule > type the x-, then the y- and finally the z-angle > select the occurrence you want to rotate and thats it..
i hope it helps you a little 🙂
Rule-Code:
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim oMatrix1 As Matrix
oMatrix1 = oTG.CreateMatrix
Dim oAsm As AssemblyDocument
oAsm = ThisApplication.ActiveDocument
Dim oOcc As ComponentOccurrence
'oOcc = oAsm.SelectSet(1)
oOcc = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select an Occurrence..")
Dim oMatrix As Matrix
oMatrix = oOcc.Transformation
Dim dCells(15) As Double
oMatrix.GetMatrixData(dCells)
dPi = Atan(1)*4
Dim dPhi As Double ' x-Winkel
dPhi = InputBox("Phi", "iLogic", "Grad")
Dim dTheta As Double ' y-Winkel
dTheta = InputBox("Theta", "iLogic", "Grad")
Dim dPsi As Double ' z-Winkel
dPsi = InputBox("Psi", "iLogic", "Grad")
dPhi_b = dPhi/180*dPi
dTheta_b = dTheta/180*dPi
dPsi_b = dPsi/180*dPi
oMatrix1 = oOcc.Transformation
oMatrix1.Cell(1,1) = Cos(dTheta_b)*Cos(dPsi_b)
oMatrix1.Cell(1,2) = Cos(dTheta_b)*Sin(dPsi_b)
oMatrix1.Cell(1,3) = -Sin(dTheta_b)
oMatrix1.Cell(2,1) = Sin(dPhi_b)*Sin(dTheta_b)*Cos(dPsi_b)-Cos(dPhi_b)*Sin(dPsi_b)
oMatrix1.Cell(2,2) = Sin(dPhi_b)*Sin(dTheta_b)*Sin(dPsi_b)+Cos(dPhi_b)*Cos(dPsi_b)
oMatrix1.Cell(2,3) = Sin(dPhi_b)*Cos(dTheta_b)
oMatrix1.Cell(3,1) = Cos(dPhi_b)*Sin(dTheta_b)*Cos(dPsi_b)+Sin(dPhi_b)*Sin(dPsi_b)
oMatrix1.Cell(3,2) = Cos(dPhi_b)*Sin(dTheta_b)*Sin(dPsi_b)-Sin(dPhi_b)*Cos(dPsi_b)
oMatrix1.Cell(3,3) = Cos(dPhi_b)*Cos(dTheta_b)
oOcc.Transformation = oMatrix1
Aleksandar Krstic
Produkt- und Projektmanager

