Can someone explain to me where I am i going wrong…?
How to move or translate the text notes…? Any nodes/codes…??
At first glance it looks like there’s no “easy” way to do this. I don’t think text notes will move like other elements because they require a referencing view since they’re annotation elements. Your best bet would probably be to place new elements at the new locations and delete the old ones.
@Kulkul to the rescue!
As always 
import clr
from System.Collections.Generic import *
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
import Autodesk
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
items = {UnwrapElement(IN[0])}
xyz = UnwrapElement(IN[1]).ToXyz()
ids = list()
for item in items:
ids.append(item.Id)
itemlist = List[ElementId](ids)
TransactionManager.Instance.EnsureInTransaction(doc)
moveditems = ElementTransformUtils.MoveElements(doc,itemlist,xyz)
TransactionManager.Instance.TransactionTaskDone()
Thanks a lot Kulkul for your assistance…! I have created my First python script…!
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
clr.AddReference(“RevitAPI”)
clr.AddReference(“RevitNodes”)
clr.AddReference(“RevitServices”)
clr.AddReference(‘RevitAPIUI’)
import Autodesk
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Autodesk.Revit.DB import *
from Autodesk.DesignScript.Geometry import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc= DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
TextNoteId= UnwrapElement(IN[0]).Id
NewLocation=UnwrapElement(IN[1]).ToXyz()
#The inputs to this node will be stored as a list in the IN variables.
Move=ElementTransformUtils.MoveElement(doc,TextNoteId,NewLocation)
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = IN[0]
Also I would start a new post to know the possible drawbacks of importing so many modules into library
I do this because often I get confused on what to import for what…!
@saju_autodesk please mark the post as solved. You’re welcome!
finally here…! successfully aligned the text notes as required thanks @Kulkul and @Nick_Boyts…!
text.dyn (45.0 KB)
Alright…! now its time to move to next step starting a new topic" Extracting leader curves from text note " see you there…!
@Kulkul Could you show me how to use the similar method to rotate the text instead of moving it?
Hate to dig this one up. Could someone please show me a snapshot of what @Kulkul 's python node should look like in the editor? I’m having issues recreating it.
Copy paste below script in python editor:
import clr
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
items = {UnwrapElement(IN[0])}
xyz = UnwrapElement(IN[1]).ToXyz()
ids = list()
for item in items:
ids.append(item.Id)
itemlist = List[ElementId](ids)
TransactionManager.Instance.EnsureInTransaction(doc)
moveditems = ElementTransformUtils.MoveElements(doc,itemlist,xyz)
TransactionManager.Instance.TransactionTaskDone()
Thank You!!
Hello @Kulkul ,
I was hoping to use your script for “Material Tags”, but I get an error on the python note that the elements don’t have an Element ID (line 24: "itemlist = ListElementId).
I was looking for a fix to the annoying issue of Material Tags loosing their reference briefly. There are ideas floating around to move them slightly back and forth, though I couldn’t find a definite answer on the forum. Is this a hopeless quest?
Thanks,
Philipp
Hello, can you explain please were you get that “text location” node? is from a package or is that the python script?
I’d like to know too…