
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi ,
Can someone help me to delete a Work Axis of a Hole which is the Parent hole of the circular pattern.
I have written to create Axis for the Parent hole feature of the circular pattern.
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim oWorkAxis As WorkAxis
' Get all the Circular Pattern from Part Feature.
For i = 1 To oPartDoc.ComponentDefinition.Features.CircularPatternFeatures.Count
Dim oCirPattern As CircularPatternFeature
Set oCirPattern = oPartDoc.ComponentDefinition.Features.CircularPatternFeatures.Item(i)
If oCirPattern.ParentFeatures.Item(1).Type = kHoleFeatureObject Then
'To delete if the Axis for the Parent Hole aleady exists -----------------> Need Help here to Identify the Work Axis of the Parent Hole feature of Circular Pattern
For Each oWorkAxis In oPartDoc.ComponentDefinition.WorkAxes
If oWorkAxis.DefinitionType = kRevolvedFaceWorkAxis Then
oWorkAxis.Delete
End If
Next
Set oWorkAxis = oPartDoc.ComponentDefinition.WorkAxes.AddByRevolvedFace(oCirPattern.ParentFeatures.Item(1).Faces.Item(1), False)
oWorkAxis.Visible = true
MsgBox "Axis Enabled for " & oCirPattern.Name & "
End If
Next i
---------------------------------------------------
Thanks in Advance
Regards
Alex
Solved! Go to Solution.