You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to use with statement on Disposable .Net Object
import clr
import sys
import re
import System
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
with Transaction(doc, 'CommandName') as t:
print(f"{t=}")
print(t.GetType().ToString())
t.Start()
# do stuff
t.Commit()
What did you expect to see?
no error
What did you see instead?
Attribute Error
What packages or external references (if any) were used?
Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.
Dynamo Version
Dynamo 3.3 and more
Host
Revit or Civil3D
Operating System
Windows 11
What did you do?
Try to use with statement on Disposable .Net Object
What did you expect to see?
no error
What did you see instead?
Attribute Error
What packages or external references (if any) were used?
No response
Stack Trace
No response
Details
FYI @twastvedt
The text was updated successfully, but these errors were encountered: