Hi @joao.araujoDNTFK .
I don't think the mesh repair command is provided in the API, but I made a sample using a text command.
# Fusion360API Python script
import traceback
import adsk.core as core
def run(context):
ui = core.UserInterface.cast(None)
try:
app: core.Application = core.Application.get()
ui = app.userInterface
msg: str = 'Select MeshBody'
selFilter: str = 'MeshBodies'
sel: core.Selection = selectEnt(msg, selFilter)
if not sel:
return
exec_mesh_repair('Wrap')
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def exec_mesh_repair(
repairType: str):
repairTypeDict = {
'Close Holes': 'infoTypeSimple',
'Stitch and Remove': 'infoTypeDefault',
'Wrap': 'infoTypeExtended',
'Rebuild': 'infoTypeMakeSolid',
}
if not repairType in repairTypeDict.keys():
return
app: core.Application = core.Application.get()
app.executeTextCommand(u'Commands.Start ParaMeshRepairCommand')
app.executeTextCommand(u'Commands.SetString infoRepairType {}'.format(repairTypeDict[repairType]))
app.executeTextCommand(u'NuCommands.CommitCmd')
def selectEnt(
msg: str,
filterStr: str) -> core.Selection:
try:
app: core.Application = core.Application.get()
ui: core.UserInterface = app.userInterface
sel = ui.selectEntity(msg, filterStr)
return sel
except:
return None
For more information about text commands, please read here.
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands/m-p/9645688
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands2/m-p/9937161