Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All,
Does anyone know if the Inspect/Validate Tool is available in the API?
Eric
Solved! Go to Solution.
All,
Does anyone know if the Inspect/Validate Tool is available in the API?
Eric
Solved! Go to 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.
Therefore, I could not find a way to execute the command continuously.