Here’s a good post from Jeremy: http://thebuildingcoder.typepad.com/blog/2014/09/revit-2015-r2-ur4-and-dimension-prefix-suffix.html
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?
Hi Joaquim,
Are you looking to override Dimension Text Values?
Hi Kulkul,
Yes, something like prefix or sufix. Your script seems very close of what i’m searching. How did you did it?
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.
Thank you Kulkul. Your help will be welcome!
Thank you for your reply Vikram!
I’m trying to find a way to change dimensions, even with multiple segments
@Joaquim_Danado This should do the needful
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]
Hi Vikram, thank you for your help!
It works pretty well. I tried it not for selected elements but catching all elements and it works fine.
Thank you a lot
Hi Vikram i tried running your code block but it gives me syntax errors.
thanks,
S
Hi @Kulkul !
I’m a new with Dynamo and your script in that gif is exactly what I have been looking for, how do I do it?
Add List.Create after SelectModelElement node. Next time please start new thread.
Thank you so much @Kulkul it worked. One last question when I use the Select Model Elements I can’t select any instance. Do you know why?
Crossing window selection. Right?
Yes!