Inventor Customization

Reply
Valued Mentor
saseendrankombath
Posts: 357
Registered: ‎11-11-2005
Message 1 of 3 (135 Views)

iMate conflict checking

135 Views, 2 Replies
11-22-2012 03:20 AM

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

Valued Mentor
saseendrankombath
Posts: 357
Registered: ‎11-11-2005
Message 2 of 3 (125 Views)

Re: iMate conflict checking

11-26-2012 10:12 AM in reply to: saseendrankombath

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

 

Contributor
Burnit87
Posts: 19
Registered: ‎02-27-2014
Message 3 of 3 (30 Views)

Re: iMate conflict checking

04-23-2014 11:19 AM in reply to: saseendrankombath

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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.