How to recompute document when calling grasshopper file in pyrevit

How to recompute document when calling grasshopper file in pyrevit, I think it can help me solve some of my current problems,But I don’t know how to achieve it.

If you want to regenerate Revit document after some actions in your code you can just use:
doc.Regenerate()