Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Folks,
I'm attempting to create a bunch of composite iMates in an assembly, but I keep running into errors as I try to create them. I can create standard iMates no problem, but then using the created iMates to create a composite iMate is proving problematic.
To try trouble shoot, I manually created 3 iMates (test1, test2, test3) and then tried to use these to create the composite to no avail.
My test code is below:
Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
Dim o_iMateDefinitions As iMateDefinitions = oCompDef.iMateDefinitions
Dim o_iMateDefinition1 As iMateDefinition
Dim o_iMateDefinition2 As iMateDefinition
Dim o_iMateDefinition3 As iMateDefinition
Dim iMateCollection As ObjectCollection
For index = 1 To o_iMateDefinitions.Count
If o_iMateDefinitions.Item(index).Name = "test1" Then
o_iMateDefinition1 = o_iMateDefinitions.Item(index)
ElseIf o_iMateDefinitions.Item(index).Name = "test2" Then
o_iMateDefinition1 = o_iMateDefinitions.Item(index)
ElseIf o_iMateDefinitions.Item(index).Name = "test3" Then
o_iMateDefinition1 = o_iMateDefinitions.Item(index)
End If
Next
iMateCollection.Add(o_iMateDefinition1)
iMateCollection.Add(o_iMateDefinition2)
iMateCollection.Add(o_iMateDefinition3)
Dim oCompImate As CompositeiMateDefinition = o_iMateDefinitions.AddCompositeiMateDefinition(iMateCollection, "CompositeTest")
Any help would be greatly appreciated!
Cheers,
Q Visser
Current Software:
Inventor Professional 2024.2 & Vault Professional 2024.2
Q Visser
Current Software:
Inventor Professional 2024.2 & Vault Professional 2024.2
Solved! Go to Solution.