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: 

Create a axis perpendicular at point

Message 1 of 6
232 Views, 5 Replies

Create a axis perpendicular at point

When I create a construction axis “perpendicular at point” in the UI, I only need to click a face, and the software create a axis perpendicular to the selected face AT THE EXACT POINT ON THE FACE WHERE I SELECTED IT WITH THE CURSOR. 

when I try to use the API to create this feature with help of user inputs, the API says that the feature need a face AND a pint as arguments. 

how can I get the functionality that the UI gives, meaning selecting the face and the point in one click? 
is it even possible?


also, it’s it possible to get the coordinates of where the mouse cursor is when hoovering over a face and it gets blue ( ready to be selected)? Or even when hoovering over a face that is already selected?


@BrianEkins @prainsberry 

Message 2 of 6

Hi @oyvindTMNSU 
You can able to get the point with the selection object

Here is the little snippet which replicates the functionality of create axis perpendiculat at point I have used the userInterface select entity method to do it. you can also use selection Input command as well.

def run(context):
    ui = None
        app = adsk.core.Application.get()
        ui  = app.userInterface
        doc = app.activeDocument
        design : adsk.fusion.Design = doc.products.itemByProductType('DesignProductType')

        ## Create axis perpendicular to point
        selction = ui.selectEntity("Select a face", "PlanarFaces")

        if selction and selction.entity.objectType == adsk.fusion.BRepFace.classType():
            face :adsk.fusion.BRepFace = selction.entity
            point = selction.point

            construcntionAxisInput = design.rootComponent.constructionAxes.createInput()

            construcntionAxisInput.setByPerpendicularAtPoint(face, point)

            axis = design.rootComponent.constructionAxes.add(construcntionAxisInput)
        if ui:


Boopathi Sivakumar
Senior Technology Consultant

Message 3 of 6
in reply to: oyvindTMNSU

Thank you very much! I will try that.


Another question, how can I get the effect that the hole feature gives when selecting a point? That the center point of the circle shows up and its possible to snap to it?
See video.


Message 4 of 6

Hi @oyvindTMNSU 

Its a combination of preview handler and custom graphics

here is a sample example 

Boopathi Sivakumar
Senior Technology Consultant

Message 5 of 6
in reply to: oyvindTMNSU

is it possible to display custom graphics when hovering over an entity? For example when hovering over a face it will be blue, on that que a want to display a custom graphics. a line normal to the face the user hover over. Following the position of the cursor until its clicked and then the line become permanent (permanent during preview).


Message 6 of 6
in reply to: oyvindTMNSU





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