I m trying to inactivate the edge fillet and chamfer feature to simplify the CATIA model. I made the macro code as follow.
However, obiously, if the other features refer the fillet or chamfer, the part cannot be updated.
Thus, I want to inactivate the all children features, but I cannot find how to get the children relationship of selected feature.
Please give me help or insight to solve this problem
Thank you for your help
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
If Err.Number = 0 Then
Dim selection1 As Selection
Set selection1 = partDocument1.Selection
selection1.Search "Name=*fillet*,all"
If selection1.Count = 0 Then
MsgBox "No fillet features"
Else
For i = 1 To selection1.Count
part1.Inactivate (selection1.Item2(i).Value)
Next 'i
'part1.Update
End If
Dim selection2 As Selection
Set selection2 = partDocument1.Selection
selection2.Search "Name=*chamfer*,all"
If selection2.Count = 0 Then
MsgBox "No chamfer features"
Else
For j = 1 To selection2.Count
part1.Inactivate (selection2.Item2(j).Value)
Next 'j
'part1.Update
End If
part1.Update
MsgBox ( tot_f_c_num & " features are inactivated.")
Else
MsgBox "Not a part document! Open a single part document."
End If
End Sub