adding components to an existing finish definition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I have an assembly with some parts (only first level). I created a finish, but because there is also a pattern I want to add all components / ocurrences / bodies /proxies... to this finish. but it does not work. can someone help me? thx.
my code:
Private Sub addComponentsToFinish(samenstelling As Inventor.AssemblyDocument)
Dim compAssyDef As Inventor.AssemblyComponentDefinition
compAssyDef = samenstelling.ComponentDefinition
Dim finishFeatures As FinishFeatures = compAssyDef.Features.FinishFeatures
Dim objCol As ObjectCollection = _inventorApplication.TransientObjects.CreateObjectCollection()
For Each finish As Inventor.FinishFeature In finishFeatures
finish.Definition.IncludedEntities.Clear()
'Controleer of het een FinishFeature is
If finish.Type = Inventor.ObjectTypeEnum.kFinishFeatureObject Then
For Each oCompOcc As Inventor.ComponentOccurrence In compAssyDef.Occurrences
Dim compDef As ComponentDefinition = CType(oCompOcc.Definition, ComponentDefinition)
For Each oBody As SurfaceBody In compDef.SurfaceBodies
Dim oBodyProxy As SurfaceBodyProxy = Nothing
oCompOcc.CreateGeometryProxy(oBody, oBodyProxy)
objCol.Add(oBody)
Next
Next
'finish.SetAffectedBodies(objCol) '??
finish.Definition.IncludedEntities.Add(objCol) '??
End If
Next
End Sub
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan