Visual preview of model change

I’m trying to see if I can create a visual preview of a model change before committing to it. Basically trying to replicate what is happening in this video:

I haven’t had any luck looking through the API. One thing I was thinking is they could be:

  1. copying the elements
  2. rotating them
  3. overriding the graphics
  4. deleting them after committing to the change

I’ve done temporary geometry as a direct shape that I’ve committed inside of a nested subtransaction that could be rolled back before committing the final transaction. Something like this:

trans = DB.Transaction(doc, "Main Transaction")
trans.Start()

subt_1 = DB.SubTransaction(doc)
subt_1.Start()

subt_2 = DB.SubTransaction(doc)
subt_2.Start()
#Build your temp geometry here
subt_2.Commit()
doc.Regenerate()

#preview geometry is shown while code here is run

subt_1.RollBack() #Preview geometry is rolled back here

trans.Commit()

It is obviously a little more complicated if you have a form and are updating temp geometry based on form responses, but I’ve used this process before to display selectable preview geometry.

I actually JUST finished my script in the last 5 mins and basically followed the steps I guessed at in my first post. Seems to work well enough. I’ve never used SubTransaction, is there a good reason to?