Inventor Customization

Inventor Customization

Reply
Valued Mentor
361 Posts
13 Kudos
Registered: ‎11-11-2005
Post 1 of 3

iMate conflict checking

139 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
361 Posts
13 Kudos
Registered: ‎11-11-2005
Post 2 of 3

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
19 Posts
2 Kudos
Registered: ‎02-27-2014
Post 3 of 3

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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!