Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMate conflict checking

2 REPLIES 2
Reply
Message 1 of 3
saseendrankombath
322 Views, 2 Replies

iMate conflict checking

How to ietrate thru assembly documet and find out any imate results are conflict in the Assembly document?

2 REPLIES 2
Message 2 of 3

Solved !

 

 oAssyDoc = m_inventorApplication.ActiveDocument
        oAssyCompDef = oAssyDoc.ComponentDefinition

        Dim oConstraint As AssemblyConstraint
        Dim oObjectCol As ObjectCollection
        oObjectCol = m_inventorApplication.TransientObjects.CreateObjectCollection

        For Each oConstraint In oAssyCompDef.Constraints
            If oConstraint.HealthStatus = HealthStatusEnum.kInconsistentHealth Then
                oObjectCol.Add(oConstraint)
            End If
        Next

        If oObjectCol.Count <> 0 Then
            MsgBox(oObjectCol.Count & " - Inconsistent Constraints found in this Assembly, Please Correct it before using Bolt Insert")            
            Exit Sub
        End If

 

Message 3 of 3

this works for me

 

find first part of imate in part occurrence

Dim iMatemate1a As iMateDefinition
For Each iMatemate1a In prtbakXocc.iMateDefinitions
If iMatemate1a.Name = "imate_name" Then
Exit For
End If
Next

 

find second part of imate in part occurrence

Dim iMatemate1b As iMateDefinition
For Each iMatemate1b In prtbakXocc.iMateDefinitions
If iMatematex1b.Name = "imate_name_2" Then
Exit For
End If
Next

 

add them together

Dim oiMateResult1 As iMateResult
oiMateResult1 = m_ThisAssembly.ComponentDefinition.iMateResults.AddByTwoiMates(iMatemate1a, iMatemate1b)

BP

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report