How to retrieve workplane constraints
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a situation where I need to retrieve all component occurances that have a constraint to a particular work plane. My code below is a start but once I get the contrstraints (in the for loop), I have no idea on how to retrieve the property of the constraint that tells me what it is constrained to. Any ideas?
Thanks
Dim occ As ComponentOccurrence
Dim Occurrences As Inventor.ComponentOccurrences = oAssemblyDocument.ComponentDefinition.Occurrences
For Each occ In Occurrences
If occ.DefinitionDocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Or _
occ.DefinitionDocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
myConstraintCount = occ.Constraints.Count
If myConstraintCount > 0 Then
For i = 1 To myConstraintCount
'how do I get the constraint property that tells me what it is constrained to?
Debug.Print(occ.Constraints.Item(i).Name)
Next
End If
End If
Next