When to use dispose() in pyRevit / IronPython

Hello All.

I have been trying to understand when to use dispose() on IDisposable (let’s say public class PDFExportOptions : IDisposable). After doing a research and asking 2 chat gpts (one says use dispose() as soon as you see it’s IDisposable, the other says don’t use dispose()).

Does anyone have an understanding when to use dispose()? Please advise.

The only Dispose I used to be with a transaction.
Dispose means “Nevermind” I use it a lot if I need to temporarily add elements to the database without committing the transaction.

That is with my limited knowledge here.

1 Like