Message 1 of 4
iLogic Extrude in Assembly

Not applicable
01-26-2021
05:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I'm having some issues with an iLogic model regarding an Extrude function used within an Assembly;
The extrude runs fine on execution - however when expanding the amount of components in the assembly the newly added components are not participating in the extrude command.
To overcome this I copy-pasted some code together (using he forum as a source) to add the instances to my Extrude Command using 2 FOR loops.
However - this code executes slow on 'larger' assemblies (+50 parts).
Is there is faster way to add all components in the assembly to the extrude function?
See code below;
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmDoc= ThisApplication.ActiveDocument
Dim oDef As AssemblyComponentDefinition
oDef = oAsmDoc.ComponentDefinition
Dim oAssemblyFeatures As Features
oAssemblyFeatures = oDef.Features
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oDef.Occurrences
'If oOccurrence.Name = "FeatureName" Then
oOcc = oOccurrence
'Else
'End If
Dim oAssemblyFeature As PartFeature
'Iterate through all of the assembly features
For Each oAssemblyFeature In oAssemblyFeatures
If oAssemblyFeature.Name = "ExtrusionHeight" Then
'add the occurrence to the feature
oAssemblyFeature.AddParticipant(oOcc)
Else
End If
Next
Next
'Update
InventorVb.DocumentUpdate()
Thanks in advance for the help & insights.