Hello,
I'm working with CATIA V6 and I have a main assembly made of parts and subassemblies. Those parts and subassemblies are linked together by revolute joints.
Does anyone know how I could write a macro to find the name of the parts or subassemblies involved in a particular joint?
I took a look at this post, (which I'm still not able to replicate in V6):
For example;
With this code I'm able to know the name of the constraint and a lot more information, but I cannot know what part(s) or subassemblies are involved in the constraints...
Does anyone know how I could achieve that?
I'm working with CATIA V6 and I have a main assembly made of parts and subassemblies. Those parts and subassemblies are linked together by revolute joints.
Does anyone know how I could write a macro to find the name of the parts or subassemblies involved in a particular joint?
I took a look at this post, (which I'm still not able to replicate in V6):
For example;
Code:
Dim MyMechRep As KinMechanism
Set MyMechRep = MyRep.GetItem("MECHRep")
Dim MyJoints As KinJoints
Set MyJoints = MyMechRep.Joints
TmpSel.Add MyJoints.Item(1)
Dim AReference As Reference
For i = 1 To MyJoints.Count Step 1
Dim MyJoint As EngConnection
Set MyJoint = MyJoints.Item(i)
If (MyJoint.Type = 8 Or MyJoint.Type = 0) Then ' This means we have detected a revolute Joint
MsgBox "We have detected a revolute joint!"
Dim ListOfAssemblyConstraints As AssemblyConstraints
Dim AConstraint As AssemblyConstraint
Set ListOfAssemblyConstraints = MyJoint.AssemblyConstraints
MsgBox ListOfAssemblyConstraints.Count
For zz = 1 To ListOfAssemblyConstraints.Count Step 1
Set AConstraint = ListOfAssemblyConstraints.Item(zz)
MsgBox "Name : " & AConstraint.Name & "Nb of Options: " & AConstraint.GetNbOptions & "Nb of values: " & AConstraint.GetNbValues
Next
End If
Next
With this code I'm able to know the name of the constraint and a lot more information, but I cannot know what part(s) or subassemblies are involved in the constraints...
Does anyone know how I could achieve that?