Transaction logic

Hi

I am having issues with transaction logic. I am trying to improve Modelical’s ‘3D views by worksets’ node. The idea is to create isolated workset views. However the Modelical node duplicates views if it has already been created. My workaround tests to see if a view has been created and only creates a new view if a new workset has been added since the last time it was executed. Then all of the 3d views (new and old) are set to have only a single workset visible.

The problem I am facing is that I can’t seem to have both the new axonometric view created AND the workset isolation to occur in the same script. I think it has something to do with transactions and the order things are executed.

Any ideas?

FileWorking_Simple.dyn (24.7 KB)

Looking at your code. It seems that tracebacking your codes from line 49 to line 43 to line 22 -OUT is null suggests that IN[1] is null. So the issue might not be the transaction but the views created - essentially if views is null, line 33 “for v in null” will not work, then the chunk from line 34 to line 42 is skipped, you cannot tell if transaction fails at this point.