- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Tired of trying to convert fillets to chamfers on a part with Inventor Ilogic with the attached rule. It gives the following error: "Public member 'Edges' cannot be found on type 'FilletFeature'" In the line "oEdges = oFillet.Edges
" Any suggestions for this trouble?
I Used this rule:
' iLogic Rule: ReplaceFilletsWithChamfers
' Get the active part document
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
' Get the component definition
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
' Create a transient object for collections
Dim oTransientObjects As TransientObjects
oTransientObjects = ThisApplication.TransientObjects
' List to store edges from fillets
Dim filletEdgesCollection As ObjectCollection
filletEdgesCollection = oTransientObjects.CreateObjectCollection
' Collect all fillet features first to avoid modification during iteration
Dim filletList As List(Of FilletFeature) = New List(Of FilletFeature)
Dim oFillet As FilletFeature
For Each oFillet In oCompDef.Features.FilletFeatures
filletList.Add(oFillet)
Next
' Iterate through all fillet features in the part
For Each oFillet In filletList
' Get the collection of edges from the fillet
Dim oEdges As ObjectCollection
oEdges = oFillet.Edges
For Each oEdge As Edge In oEdges
filletEdgesCollection.Add(oEdge)
Next
' Delete the fillet feature
oFillet.Delete()
Next
' Define the chamfer size
Dim chamferDistance As Double
chamferDistance = 0.1 ' Change this value to the desired chamfer size
' Create the chamfer feature using the collected edges
If filletEdgesCollection.Count > 0 Then
Dim oChamferDef As ChamferFeatureDefinition
oChamferDef = oCompDef.Features.ChamferFeatures.CreateChamferFeatureDefinition
oChamferDef.SetToEqualDistance(chamferDistance)
oChamferDef.Edges.Add(filletEdgesCollection)
Dim oChamferFeature As ChamferFeature
oChamferFeature = oCompDef.Features.ChamferFeatures.Add(oChamferDef)
End If
' Update the part document
oDoc.Update()
' Message to indicate the rule has run
MessageBox.Show("All fillets have been replaced with chamfers.", "iLogic Rule")
Solved! Go to Solution.