Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Editing API for fillet length

3 REPLIES 3
Reply
Message 1 of 4
NemKumar
415 Views, 3 Replies

Editing API for fillet length

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,

3 REPLIES 3
Message 2 of 4
Vladimir.Ananyev
in reply to: NemKumar

Inventor API Help contains the sample “Fillet Feature (Complex)” that illustrates how you can use the FilletDefinition object to create the FilletFeature.

FilletDemo.PNG

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

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 4
NemKumar
in reply to: Vladimir.Ananyev

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.

Message 4 of 4
Vladimir.Ananyev
in reply to: NemKumar

API to create fillet features is provided by FilletFeatures object.  Please look at the Inventor API Help for its methods  Add, CreateFilletDefinition, AddSimple.  
Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report