Catia macro to get rotation axis?
Catia macro to get rotation axis?
(OP)
Hello everyone,
I have an assembly with two parts that are linked by a revolute joint. I want to write a macro to get the orientation of the revolution axis?
Any idea how to do that?
Thanks!
I have an assembly with two parts that are linked by a revolute joint. I want to write a macro to get the orientation of the revolution axis?
Any idea how to do that?
Thanks!





RE: Catia macro to get rotation axis?
So if by chance someone knew, I would be very interested how I could accomplished that directly or indirectly...
Thanks
RE: Catia macro to get rotation axis?
CODE --> catvba
Sub CATMain() Dim oDoc As Document Set oDoc = CATIA.ActiveDocument Dim oProd As Product Set oProd = oDoc.Product Dim oConstraintsCol As Constraints Set oConstraintsCol = oProd.Connections("CATIAConstraints") Dim oCoincid As Constraint Set oCoincid = oConstraintsCol.Item(2) ' I have a fix as the first constraint Dim oRef1 As Reference Set oRef1 = oCoincid.GetConstraintElement(1) ' get first element of the coicidence oDoc.Selection.Clear oDoc.Selection.Add oRef1 ' just for fun Dim TheSPAWorkbench As Workbench Set TheSPAWorkbench = oDoc.GetWorkbench("SPAWorkbench") Set TheMeasurable = TheSPAWorkbench.GetMeasurable(oRef1) Dim aAxisVector(2) TheMeasurable.GetDirection aAxisVector MsgBox (" vector of coincidence = " _ & aAxisVector(0) & "," & aAxisVector(1) & "," & aAxisVector(2)) oDoc.Selection.Clear End Subindocti discant et ament meminisse periti