Update Transaction

hi !
I am trying to change the position, elbow, and end of a Room tag or any other tag. After making these changes, the updates do not reflect. I need to change the LevelOfDetail to Fine, Medium, or Coarse for the transaction to update. I attempted to implement this in my code, but it does not work when the view has a template. I also tried using Regenerate(doc), but it still doesn’t work. After running the code, I still need to change the LevelOfDetail. Is there any way to update the display without having to do that?
here is the python Node i use for set Head Position, another one is the same

import clr

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

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

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

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument


def SetSpatialTagHeadPosition(spatialTag,point):
    TransactionManager.Instance.EnsureInTransaction(doc)
    spatialTag.TagHeadPosition = point.ToRevitType(True) #cast point to revit type
    TransactionManager.Instance.TransactionTaskDone()
    return spatialTag


spatialTags = UnwrapElement(IN[0])
locationPoints = UnwrapElement(IN[1])


if isinstance(IN[0], list): OUT = [SetSpatialTagHeadPosition(t,p) for t,p in zip(spatialTags,locationPoints)]
else: OUT = SetSpatialTagHeadPosition(spatialTags,locationPoints)


Hey,

It seems likeinconsistent behaviour, the people here are ‘wiggling’ the tag to make it update!

Hope that helps,

Mark

Have you tried refreshing the view by calling UIDocument.RefreshActiveView()…

For views that are not active, you can iterate over all open views, set as the active view and call refresh. Often UI Elements don’t get updated unless this is called.

Also, might be as Mark said and the solution on the revit forum may be what’s needed. You might be able to achieve this effect by doing a false delete (deleting and rolling back the transaction) tricking revit into thinking it needs a refresh.

As a side note, you might want to move the transaction out of the function, this will wrap all the updates into one transaction.