10-07-2019
02:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-07-2019
02:58 AM
Thanks this helped me a lot also works for RectangularPatternFeature to swap around ParentFeature
Public Sub ChangeElem(oPartDef As PartComponentDefinition, oDoc As Document)
Dim oPartFeature As PartFeature
Set oPartFeature = oPartDef.features.HoleFeatures.Item("TRP3_HOLE")
Dim oRPF As RectangularPatternFeature
Set oRPF = oPartDef.features.RectangularPatternFeatures.Item("TopPattern")
Dim objCol As ObjectCollection
Set objCol = oRPF.Definition.ParentFeatures
'I added the clear so I can swap the old ParentFeature with a new one
Call objCol.Clear
Call objCol.Add(oPartFeature)
oRPF.Definition.ParentFeatures = objCol
oRPF.Definition.NaturalXDirection = False
oDoc.Update
End Sub