The oChamferFeature.Definition.Parent.ChamferedEdges works too in this case, but it is actually the ChamferFeature.ChamferedEdges and it is hidden now, so I recommend to use the oChamferFeature.Definition.ChamferedEdges.
I added some lines to set the EndofPart node:
Sub GetChamferedEdgesCount()
Dim oRefDoc As PartDocument
Set oRefDoc = ThisApplication.ActiveDocument
' Get the referenced document component definition
Dim oCD As PartComponentDefinition
Set oCD = oRefDoc.ComponentDefinition
' get the original position of End of Part node.
Dim oBefore As Object, oAfter As Object
oCD.GetEndOfPartPosition oAfter, oBefore
' Get the referenced document feature collection
Dim oFeatures As PartFeatures
Set oFeatures = oCD.Features
Dim oFeature As PartFeature
' Get the referenced document feature count
Dim oFeatureCount As Integer
oFeatureCount = oFeatures.Count
' Get the referenced document hole feature collection
Dim oHoles As HoleFeatures
Set oHoles = oFeatures.HoleFeatures
' Get the referenced document chamfer feature collection
Dim oChamfers As ChamferFeatures
Set oChamfers = oFeatures.ChamferFeatures
'Dim oChamferCount As Integer = oChamfers.Count
oChamferCount = oChamfers.Count
Dim oEdge As Edge
Dim oChamferFeature As ChamferFeature
For Each oChamferFeature In oChamfers
' move the feature under the End of Part node to get the chamfered edges.
Call oChamferFeature.SetEndOfPart(True)
MsgBox oChamferFeature.Name & " has " & oChamferFeature.Definition.ChamferedEdges.Count & " chamfered edges."
For Each oEdge In oChamferFeature.Definition.ChamferedEdges
oRefDoc.SelectSet.Select oEdge
Next
Call oChamferFeature.SetEndOfPart(False)
Next
' MsgBox (oChamferCount)
' restore the position of End of Part node.
oAfter.SetEndOfPart False
End Sub
If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.
Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.