- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This topic follows on the discussion at [this topic]. I'm working with iLogic in Inventor Professional 2025.
I've got a number of assembly-level component patterns that are tied to part-level feature patterns, and when a part pattern is suppressed, the associated assembly pattern throws various errors, depending on my approach to the problem, even when the assembly patterns and their constraints are suppressed.
The structure of my model is:
- Assembly (with dependent occurrence pattern)
- Subassembly
- Part (with defining feature pattern)
- Subassembly
Based on the above-linked discussion I've created a dummy pattern of the origin point, and I've tried various arrangements with and without proxies for certain components, in an attempt to reassign the assembly's Feature Pattern. I haven't found an approach that works yet.
Here is my current code:
Dim dHP As Double = 1800 'For the sake of discussion
Dim bHP As Boolean
Dim oDoc_FTA As Inventor.AssemblyDocument = ThisDoc.Document
Dim oDef_FTA As Inventor.AssemblyComponentDefinition = oDoc_FTA.ComponentDefinition
Dim oOccs_FTA As Inventor.ComponentOccurrences = oDef_FTA.Occurrences
Dim oOcc_TSR_a As Inventor.ComponentOccurrence = oOccs_FTA.ItemByName("FT-ST1-2WRE-TSR") 'TSR assembly
Dim oDef_TSR_a As Inventor.AssemblyComponentDefinition = oOcc_TSR_a.Definition
Dim oOccs_TSR_a As Inventor.ComponentOccurrences = oDef_TSR_a.Occurrences
Dim oOcc_TSR_p As Inventor.ComponentOccurrence = oOccs_TSR_a.ItemByName("FT-ST1-2WRE-TSR") 'TSR part
Dim oDef_TSR_p As Inventor.PartComponentDefinition = oOcc_TSR_p.Definition
Dim oPFs_TSR_p As Inventor.PartFeatures = oDef_TSR_p.Features
Dim oCPFs_TSR_p As Inventor.CircularPatternFeatures = oPFs_TSR_p.CircularPatternFeatures
'Find dummy pattern in TSR part and create its proxies
Dim oCPF_Dummy As Inventor.CircularPatternFeature = oCPFs_TSR_p.Item("Dummy Pattern of One")
Dim oCPF_Dummy_Pxy_p As Inventor.CircularPatternFeatureProxy
Dim oCPF_Dummy_Pxy_a As Inventor.CircularPatternFeatureProxy
'Dim oCPF_Dummy_Pxy As Inventor.CircularPatternFeatureProxy
oOcc_TSR_p.CreateGeometryProxy(oCPF_Dummy, oCPF_Dummy_Pxy_p)
oOcc_TSR_a.CreateGeometryProxy(oCPF_Dummy_Pxy_p, oCPF_Dummy_Pxy_a)
'oOcc_TSR_a.CreateGeometryProxy(oCPF_Dummy, oCPF_Dummy_Pxy) 'THROWS ERROR "Unspecified error"
'Find this assembly's feature-based patterns
Dim oOPs_FTA As Inventor.OccurrencePatterns = oDef_FTA.OccurrencePatterns
Dim oFBOP_FTA As Inventor.FeatureBasedOccurrencePattern
'Stay rod border pattern
oFBOP_FTA = oOPs_FTA.Item("Border Arc")
bHP = (dHP > 1800)
Constraint.IsActive("Border Arc Insert") = bHP
If bHP Then
Dim oCPF_BA As Inventor.CircularPatternFeature = oCPFs_TSR_p.Item("Border Arc")
Dim oCPF_BA_Pxy_p As Inventor.CircularPatternFeatureProxy
Dim oCPF_BA_Pxy_a As Inventor.CircularPatternFeatureProxy
' Dim oCPF_BA_Pxy As Inventor.CircularPatternFeatureProxy
oOcc_TSR_p.CreateGeometryProxy(oCPF_BA, oCPF_BA_Pxy_p)
oOcc_TSR_a.CreateGeometryProxy(oCPF_BA_Pxy_p, oCPF_BA_Pxy_a)
' oOcc_TSR_a.CreateGeometryProxy(oCPF_BA, oCPF_BA_Pxy)
oFBOP_FTA.FeaturePattern = oCPF_BA 'THROWS ERROR "The parameter is incorrect"
' oFBOP_FTA.FeaturePattern = oCPF_BA_Pxy_p 'THROWS ERROR "The parameter is incorrect"
' oFBOP_FTA.FeaturePattern = oCPF_BA_Pxy_a 'THROWS ERROR "The parameter is incorrect"
oFBOP_FTA.Unsuppress
Else
oFBOP_FTA.FeaturePattern = oCPF_Dummy 'THROWS ERROR "The parameter is incorrect"
' oFBOP_FTA.FeaturePattern = oCPF_Dummy_Pxy_p 'THROWS ERROR "The parameter is incorrect"
' oFBOP_FTA.FeaturePattern = oCPF_Dummy_Pxy_a 'THROWS ERROR "The parameter is incorrect"
oFBOP_FTA.Suppress(True)
End If
Thanks for any assistance.
EDITED: Reformatted code for easier reading.
Solved! Go to Solution.