Inspect/Validate Bodies Tool

Inspect/Validate Bodies Tool

ebunn3
Advocate Advocate
474 Views
2 Replies
Message 1 of 3

Inspect/Validate Bodies Tool

ebunn3
Advocate
Advocate

All,

 

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

 

Eric

 

ebunn3_0-1685648687995.png

 

0 Likes
Accepted solutions (1)
475 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor
Accepted solution

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
Advocate
Advocate

Thank you @kandennti

 

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

Eric

0 Likes