Cannot start a fabrication transaction while another one is already started

Hey guys,

I translated the code from the SDK Sample: UpdateConnectionDetailedParameters.cs into a Python node in Dynamo. For extracting the parameter values it is working, but when I want to edit (WriteItem) a parameter, it is telling me that I cannot start a Transaction while another one was already started. Now I read something about Dynamo starting transations automatically, so I think that is what happening while I try to start the FabricationTransaction. Is there a way to kindly ask Dynamo NOT to start a regular transaction? So that the FabricationTransaction can be started?

Please see my code below:

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitAPISteel')
from Autodesk.Revit.DB.Steel import *

clr.AddReference('ASObjectsMgd')
from Autodesk.AdvanceSteel.DocumentManagement import *
from Autodesk.AdvanceSteel.CADAccess import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Transactions import TransactionManager

clr.AddReference('RvtDwgAddon')
import RvtDwgAddon
import Autodesk.Revit.Attributes.TransactionMode
from Autodesk.Revit.Attributes import *
from Autodesk.Revit.Attributes.TransactionMode import *
import Autodesk.Revit.Attributes.TransactionAttribute

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

baseplate = UnwrapElement(IN[0])

doc = RevitServices.Persistence.DocumentManager.Instance.CurrentDBDocument;

trans = RvtDwgAddon.FabricationTransaction(doc, False, "Extract Parameters")

eRef = Reference(baseplate)
curDocAS = DocumentManager.GetCurrentDocument()
currentDatabase = curDocAS.CurrentDatabase;
guid = SteelElementProperties.GetFabricationUniqueID(doc, eRef)
asHandle = currentDatabase.getUidDictionary().GetHandle(guid)
filerObj = FilerObject.GetFilerObjectByHandle(asHandle)
asConnection = filerObj
connectionFiler = asConnection.Save()

connectionFiler.WriteItem(40, "BaseThickness")
asConnection.Load(connectionFiler)
asConnection.Update()
rvtConnection.OverrideTypeParams = True

trans.Commit()

# Assign your output to the OUT variable.
OUT = "Parameter Edited Succesfully"

When I comment out the FabricationTransaction it does not work, because GetFilerObjectByHandle method returns zero if not done in a FabricationTransaction.
And this is the SystemError I am getting:
image
Anyone knows how to tackle this? Any advice is greatly appreciated, thanks!