My question is if there’s a way to change all dimensions prefixs, something like collecting all elements by family type and change the prefix to all that instances.
Thank you for your awnser Konrad! I forgot to mention, that I’m totally ignorant in coding. As I understand in the link you posted, he wanted to collect dimensions suffix/prefix, not to change it for a defined text. Am I wrong?
I’m sending in attachmet the codes created by Jeremy (from the first link i’ve mentioned) that’s running but nothing seems to happenGet-dimension-Value1 (1).dyn (2.0 KB)
. The other one, created by Ben Osborn (in the second link i’ve mentioned) that is working fine but just for one single dimension.dim-texts-change.dyn (2.4 KB)
Is it possible to work to all elements of a dimension type?
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
for i in UnwrapElement(IN[0]) : i.Prefix = IN[1]
TransactionManager.Instance.TransactionTaskDone()
OUT = IN[0]
Note: This doesn’t work if any of the dimensions have multiple segments.
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
for i in UnwrapElement(IN[0]):
if i.Value>=0: i.Prefix=IN[1]
else:
for j in i.Segments: j.Prefix = IN[1]
TransactionManager.Instance.TransactionTaskDone()
OUT =IN[0]