Hi,
I am required to edit the fillet length though API. I found similar API for extrusion (ExtrudeDefinition.SetDistanceExtent) . I did not find same for fillet.
Is there any such API on FilletFeature or FilletDefinition.
Also, Every feature has parameters as their property which has length etc.. Its editable property, so can we use it to edit the partfeatures length, radius , angle etc.
Thanks,
Inventor API Help contains the sample “Fillet Feature (Complex)” that illustrates how you can use the FilletDefinition object to create the FilletFeature.
FilletFeature.FeatureDimensions property returns a FeatureDimensions collection that contains all the dimensions that are associated with this fillet feature.
FilletFeature.FilletDefinition property returns FilletDefinition object. Definition gives you access to edge collection needed to calculate fillet length.
Here is the code sample that calculates the fillet length for the part shown in the picture (ipt file is attached):
Sub Fillet_Length() 'select a fillet and run this sample Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument 'selected object - face Dim oSSET As SelectSet Set oSSET = oDoc.SelectSet Dim oFace As Face Set oFace = oSSET.Item(1) 'reference to the fillet feature from the face Dim oFillet As FilletFeature Set oFillet = oFace.CreatedByFeature 'fillet definition Dim oDef As FilletDefinition Set oDef = oFillet.FilletDefinition 'get the edge collection Dim oFilletRadiusEdgeSet As FilletRadiusEdgeSet Set oFilletRadiusEdgeSet = oDef.EdgeSetItem(1) oFillet.SetEndOfPart (True) '<- requied, see help Dim oEdgeColl As EdgeCollection Set oEdgeColl = oFilletRadiusEdgeSet.Edges oFillet.SetEndOfPart (False) '<- move back 'print fillet length = sum of edges' lengths Dim LTotal As Double LTotal = 0# Dim L As Double Dim oEdge As Edge For Each oEdge In oEdgeColl L = EdgeLength(oEdge) Debug.Print FormatNumber(L, 4) LTotal = LTotal + L Next Debug.Print "LTotal = " & FormatNumber(LTotal, 4) Beep End Sub Function EdgeLength(ByRef oEdge As Edge) As Double Dim curveEval As CurveEvaluator Set curveEval = oEdge.Evaluator Dim minParam As Double Dim maxParam As Double Call curveEval.GetParamExtents(minParam, maxParam) Dim curveLength As Double Call curveEval.GetLengthAtParam(minParam, maxParam, curveLength) EdgeLength = curveLength End Function
Results (cm): 1,5000 1,5000 1,5000 1,5000 1,5000 1,5000 LTotal = 9,0000
Hi,
Thanks for the example, but that was not something I was looking for.
I am trying to simulate fillet feature through API for external 3d input device. So, I need to edit the fillet feature 20 times per second or so.
I found API on extrusion and revolve, but could not find for fillet and chamfer.
API to create fillet features is provided by FilletFeatures object. Please look at the Inventor API Help for its methods Add, CreateFilletDefinition, AddSimple.
Cheers,