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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How the fusion 360 API gets the bounding box of the parameter space

Message 1 of 9
432 Views, 8 Replies

How the fusion 360 API gets the bounding box of the parameter space

I want to use the Fusion 360 API to get a parameter space bounding box, UV bounding, for a face, but I didn't find the relevant method.

Message 2 of 9
in reply to: 2544173825

Hi @2544173825 .


It can be obtained with the SurfaceEvaluator object. 


We have created a script that displays the parameter range of the selected surface.

# Fusion360API Python script

import traceback
import adsk.fusion
import adsk.core

def run(context):
    ui = adsk.core.UserInterface.cast(None)
        app: adsk.core.Application = adsk.core.Application.get()
        ui = app.userInterface

        msg: str = 'Select'
        selFilter: str = 'Faces'
        sel: adsk.core.Selection = selectEnt(msg, selFilter)
        if not sel:

        selectFace: adsk.fusion.BRepFace = sel.entity

        eva: adsk.core.SurfaceEvaluator = selectFace.evaluator
        bBox: adsk.core.BoundingBox2D = eva.parametricRange()

        _, pointMin = eva.getPointAtParameter(bBox.minPoint)
        _, pointMax = eva.getPointAtParameter(bBox.maxPoint)

        msglst = ['-- Parameter --']
        msglst.append('-- Position --')

        if ui:

def selectEnt(
    msg: str,
    filterStr: str) -> adsk.core.Selection:

        app: adsk.core.Application = adsk.core.Application.get()
        ui: adsk.core.UserInterface = app.userInterface
        sel = ui.selectEntity(msg, filterStr)
        return sel
        return None


Note that "face.evaluator" and "face.geometry.evaluator" give different results.


Message 3 of 9
in reply to: kandennti

Thanks for your prompt reply!
This method looks very nice, but I don't quite understand statements like msg: str = 'select' which doesn't seem to be very common in python, he seems to be declaring a string type variable, but isn't the variable declaration in python possible to use msg = 'select' directly? Are the two equivalent? Also, is there any difference between select here and the entity I get via body.faces(edges)?

Message 4 of 9
in reply to: 2544173825

@2544173825 .


As for ": str", it is a python type hints.
It has no effect on execution.

If you get it with body.faces(edges), elements in the root component are fine, but for elements in the occurrence (GUI component), you will have a problem.

You need to consider about proxies here. 

Message 5 of 9
in reply to: kandennti

I found a bug with parametricRange. When I debug a program, the first time I get a 2D bounding box through this method, it seems to be fine, but when I break the debug and start it again, there are some problems with the 2D wraparound box I get. This is reflected in the returned maxpoint, which may appear as maxpoint=minpoint, or maxpoint.y=minpoint.y. When I restart VScode and Fusion 360, it returns to normal.


for face in tem_body.faces:
    face_id = face.tempId
    face_type = face.geometry.objectType
    face_normal = face.geometry.normal
    face_reversed = face.isParamReversed
    face_are = face.area
    centroid_point = face.centroid
    point_on_face = face.pointOnFace
    uvgrid(face=face, method='point')

def uvgrid(face, num_u = 10, num_v = 10, method=None, reverse = True):
    assert num_u >= 2
    assert num_v >= 2
    eval = face.evaluator
    face_para_bounding = eval.parametricRange()
    point_max = face_para_bounding.maxPoint
    point_min = face_para_bounding.minPoint



Message 6 of 9
in reply to: 2544173825

@2544173825 .


I have not tried many, but I have no such experience.
Is there an f3d file that can be attached?

Message 7 of 9
in reply to: kandennti

I have not .f3d file. I get part information from .smt file, but, I cannot upload .smt file. I had upload .step file.

Message 8 of 9
in reply to: 2544173825

@2544173825 .


Thanks for the data. smt file can be attached to the forum if you zip it.


I have seen the data. Perhaps the two sides here will be the problem.


I think it is due to the fact that they are periodic.

The periodicity can be checked by using the getParamAnomaly method. 

I have checked and U is periodic.

Message 9 of 9
in reply to: kandennti


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

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report