Edit/Add Matchlist items in Assembly with Imates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got an existing assembly in which I need to change the matchlist for the imates. I have been able to change the imate names but not the match list. There is virtually no help on this subject, I'm hoping someone has some references somewhere?
The only reference I have found creates the iMate in a part. I need to edit an existing iMate in the assembly document for the matchlist.
I have some code below, but it is not complete.
------------------------------------------------------
Set MyPart = ThisApplication.Documents.Open(strJobLocalDirectory & strLFVAssyName)
Set oAssyComp = ThisApplication.ActiveDocument.ComponentDefinition
'Dim oDoc As Inventor.AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oInsertiMate As InsertiMateDefinition
Dim iMateArray(1)
Dim oInsert As Object
For i = 1 To oAssyComp.iMateDefinitions.Count 'oOcc1.iMateDefinitions.Count
If oAssyComp.iMateDefinitions.Item(i).Name = "FillValveCL" Then
Set oiMateDef1 = oAssyComp.iMateDefinitions.Item(i)
oiMateDef1.Name = "DrainValveCL"
iMateArray(0) = oiMateDef1.Name 'Works fine till here, after this I'm lost
Set oInsert = oAssyComp.iMateDefinitions.Item(i)
Set oInsertiMate = oAssyComp.iMateDefinitions.AddMateiMateDefinition(oDoc, 0, kNoInference, , , oiMateDef1.Name)
'PROBLEM HERE!!!!
End If
If oAssyComp.iMateDefinitions.Item(i).Name = "FillValveFace" Then
Set oiMateDef1 = oAssyComp.iMateDefinitions.Item(i)
oiMateDef1.Name = "DrainValveFace"
iMateArray(0) = oiMateDef1.Name
End If
If oAssyComp.iMateDefinitions.Item(i).Name = "FillValveAngle" Then
Set oiMateDef1 = oAssyComp.iMateDefinitions.Item(i)
oiMateDef1.Name = "DrainValveAngle"
iMateArray(0) = oiMateDef1.Name
End If
Next i