DynamoDS / DynamoRevit

Dynamo Libraries for Revit
https://dynamobim.org
328 stars 184 forks source link

wrap function opens transaction and doesn't close it #2749

Open AmeerMansourBeca opened 2 years ago

AmeerMansourBeca commented 2 years ago

Dynamo version

1.3

Operating system

windows 10

What did you do?

https://forum.dynamobim.com/t/wrapping-revit-elements-to-dynamo-elements/68658/5 I was trying to wrap Revit API elements to dynamo elements using Revit Api add-in.

What did you expect to see?

if a transaction was opened then it should be closed.

What did you see instead?

this appears after wraping elements image image

Error is in RevitNodes.dll namespace : Revit.Elements class :ElementWrapper

github-actions[bot] commented 2 years ago

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.

QilongTang commented 2 years ago

Looks like this one is more Revit related and I will transfer this to DynamoRevit repo

ZiyunShang commented 2 years ago

Hi @AmeerMansourBeca , are you still experiencing this issue? As the Exception message says, there can only be one transaction at the same time. You may use TransactionManager.Instance.EnsureInTransaction(Document) to ensure your action in a transaction, or ForceCloseTransaction to end the transaction from RevitNodes.