Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question about addVariableRadiusEdgeSet when using FilletFeature

2 REPLIES 2
Reply
Message 1 of 3
chris.monachanZWSCF
251 Views, 2 Replies

Question about addVariableRadiusEdgeSet when using FilletFeature

Hello,

 

I'm confused by addVariableRadiusEdgeSet() which is a function of FilletFeatureInput(), I can't see how it is analogous to what is in the User Interface.

 

The documentation says it takes in an edge (or edges), startRadius,EndRadius, vector of radius, vector of positions.

 

The edge and vector of radii make perfect sense. For each radius you have a position which is between 0 - 1 being the start/end of the edge. If you have four entries in each of these vectors, you end up with 4 radii defining your fillet. All this shows up nicely in the UI once you do it.

As far as I can see I can set anything into the startRadius and endRadius parameters and it makes no difference. There also doesn't seem to be any corresponding display in the UI if I do. Am I missing something subtle in the documentation/UI?

Labels (1)
2 REPLIES 2
Message 2 of 3

Here's an example in the UI showing the creation of a variable radius fillet. Notice that the "Radius Type" is set to "Variable". When creating a variable radius fillet the "Radius Points" list shows up at the bottom of the dialog. They always have a start and end radius and you can insert additional radius points along the edge. I've inserted two more at 1/3 and 2/3 along the edge. The points have 0.25, 0.5, 1.0, and 0.75 radius values to get the result shown below.

 

varRadFillet.png

 

And here's the code to define the same thing using the API. It's exactly the same information that's being provided, just in a different way since we're using the API.

def run(context):
    app = None
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        des: adsk.fusion.Design = app.activeProduct
        rootComp = des.rootComponent

        edge = ui.selectEntity('Select the edge.', 'Edges').entity

        edges = adsk.core.ObjectCollection.create()
        edges.add(edge)
        fillets = rootComp.features.filletFeatures
        filletInput = fillets.createInput()
        startRad = adsk.core.ValueInput.createByString('0.25 in')
        endRad = adsk.core.ValueInput.createByString('0.75 in')
        pos = [adsk.core.ValueInput.createByReal(1/3),
               adsk.core.ValueInput.createByReal(2/3)]
        radii = [adsk.core.ValueInput.createByString('0.5 in'),
                 adsk.core.ValueInput.createByString('1.0 in')]
        filletInput.addVariableRadiusEdgeSet(edges, startRad, endRad, pos, radii)
        fillet = fillets.add(filletInput)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 

 

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3

Thanks for the reply Brian, what you show there makes sense and matches the documentation. However it's not what I see, but I think I realise why.

 

The edges I'm applying fillets to are closed loops. 

What I see is I set a start and end, then I add four positions with four values. In the UI when I look at it, I only have my four positions. There is no extra start and end point added. So I guess in a closed edge (a circle) the start and end do nothing and can be ignored? If this is the case, the API documentation could perhaps be amended just to warn those parameters do nothing on a closed edge.

Also I note in my plane C++ example I don't get Tangent Chain checked by default, again I'm guessing it's because my edge is closed. 

Would that make sense?

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

Post to forums  

Autodesk Design & Make Report