@Joshua.mursic -San.
I am not aware of any functionality to remove the Undo/Redo history.
The only way I can think of is to let the API do the manual operations.
I did a little simple test.
Create a new document and save it once.
Then run this script, which will create, save, close, and reopen the sketch repeatedly.
# 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
for _ in range(5):
des: fusion.Design = app.activeProduct
root: fusion.Component = des.rootComponent
root.sketches.add(root.xYConstructionPlane)
adsk.doEvents()
refresh_undo_redo(app.activeDocument)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def refresh_undo_redo(
doc: fusion.FusionDocument
) -> None:
if not doc.isModified: return
dataFile: core.DataFile = doc.dataFile
if not dataFile: return
app: core.Application = doc.parent
doc.save("api save")
doc.close(True)
docs: core.Documents = app.documents
docs.open(dataFile)
However, depending on the timing and the size of the data, it may not work correctly.