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: 

Inspect/Validate Bodies Tool

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ebunn3
155 Views, 2 Replies

Inspect/Validate Bodies Tool

All,

 

Does anyone know if the Inspect/Validate Tool is available in the API?

 

Eric

 

ebunn3_0-1685648687995.png

 

2 REPLIES 2
Message 2 of 3
kandennti
in reply to: ebunn3

Hi @ebunn3 .

 

had a hard time finding the command.
It's a command that is only available in the direct mode.

 

Perhaps this command is not provided in the API.
I tested it by calling the text command in the API.

# Fusion360API Python script

import traceback
import adsk
import adsk.core as core
import adsk.fusion as fusion

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

        if des.designType != fusion.DesignTypes.DirectDesignType:
            return

        exec_surface_validate(root.bRepBodies[0])

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))


def exec_surface_validate(
    targetBody: fusion.BRepBody,
) -> None:

    app: core.Application = core.Application.get()
    sels: core.Selections = app.userInterface.activeSelections

    sels.clear()
    sels.add(targetBody)

    app.executeTextCommand(u'Commands.Start FusionSurfaceValidateCommand')
    app.executeTextCommand(u'Commands.SetString checkingLevelType standardType')
    app.executeTextCommand(u'Commands.SetBool enableRepair 1')

    app.executeTextCommand(u'Commands.SetBool enableGapRepair 1')
    app.executeTextCommand(u'Commands.SetDouble gapTolerance 0.001')

    app.executeTextCommand(u'Commands.SetBool enableSmallEdgeFaceRemoval 1')
    app.executeTextCommand(u'Commands.SetDouble smallEdgesFacesTolerance 0.000001')

    app.executeTextCommand(u'Commands.SetBool enableSurfaceRefit 1')
    app.executeTextCommand(u'Commands.SetDouble surfaceRefitTolerance 0.000001')

    app.executeTextCommand(u'NuCommands.CommitCmd')

 

After executing the command, I don't know how to turn off the dialog showing the result.

1.png

Therefore, I could not find a way to execute the command continuously.

 

Message 3 of 3
ebunn3
in reply to: kandennti

Thank you @kandennti

 

I’ll check out what you’ve done as a text file.  

Eric

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