@Anonymous
You can use loops to create multiple constraints, see below code, which I have created for an example. You need to use ToString to convert it as string, just like I have used in the below code,
The below code will create a total of eight mates, of four components (Two in each) and they will be named,
- Mate-ICF-1-01, Mate-ICF-1-02 (Clamp Ferrule DIN-01, Skeleton : are the components)
- Mate-ICF-2-01, Mate-ICF-2-02 (Clamp Ferrule DIN-02, Skeleton : are the components)
- Mate-ICF-3-01, Mate-ICF-3-02 (Clamp Ferrule DIN-03, Skeleton : are the components)
- Mate-ICF-4-01, Mate-ICF-4-02 (Clamp Ferrule DIN-04, Skeleton : are the components)
I have also created some axis inside my skeleton part, named "Inlet-01-Axis", Inlet-02-Axis.....Inlet-04-Axis and they are also used in the same loop to create the mates.
You also need to be careful that you name the mates also within this loop so that you won't get an error if the name already exists.
For i = 1 To 4
Constraints.AddMate("Mate-ICF" & i.ToString & "-01", "Clamp Ferrule DIN-0" & i.ToString, "X Axis",
"Skeleton", "Inlet"& i.ToString &"Axis",
solutionType := MateConstraintSolutionTypeEnum.kOpposedSolutionType)
Constraints.AddMate("Mate-ICF" & i.ToString &"-02", "Skeleton", "Inlet" & i.ToString & "PipeDist",
"Clamp Ferrule DIN-0" & i.ToString, "Work Point5")
Next
I hope this will help you.
If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!
Regards,
Dutt Thakar
LinkedIn