Dimension override value for Above and Below

Hi,

I am trying to get all of the Dimension overriding value(Override,Above,Below,Prefix,Suffix). And need a way to match Element ID to the item with the value. So far I can’t get Dimension Above and Below value to match the list sub- sequence of other the dimension override. It comes out as a flattened list. I think of using “any true” note to filter element ID.

Thanks for any help

@seth09 post & format your code. What’s the error?

First - I need dimension value for above and below, and the only way I know how is through the python script, which produced one flattened list from all the dimension element. With dimension node like “ValueOverride node” it gives all of the value per dimension element. The issue is that I can’t figure out a way to filter the dimension element with a flattened list of a different number of the sub list.

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
dataEnteringNode = IN

doc = DocumentManager.Instance.CurrentDBDocument

dims = UnwrapElement(IN[0])
result = list()
result1 = list()
TransactionManager.Instance.EnsureInTransaction(doc)

for i in dims:
if i.Value >= 0:
result.append(i.Above), result1.append(i.Below)
else:
for j in i.Segments:
result.append(j.Above), result1.append(j.Below)
TransactionManager.Instance.TransactionTaskDone()

OUT = result,result1

Hi,

Please check this link. I’m sure it would be very helpful.

Python Dimension.Below = calculated value based on actual Dimension value(Maths) - #41 by kennyb6

2 Likes

Hi,

So I think it’s easiest for you to do a bit more work within Python and get the information out in a list format which relates the values to each other and the host dimension…

Something like this works for me?

Hope that helps,

Mark

Thanks Marks,

I come upon another issue or more a question? So to get all of my data in the same format, I modify your code to include all the other dimension override value. The result comes out different from the Revit Valueoverrides node when I compare the two. Is that because of the python code only pull out one value from the segment dimension when the override value is the same for the whole segment.

Hey,

Probably! It’s hard to say for sure without seeing your Rvt

All I would do is interrogate the list structure to match them.

Perhaps just work with 2 dimensions to start with, understand how the data is coming out, then increase the complexity…

Hope that helps,

Mark

Thanks Mark,

Thanks Durmus,

But is not what i am looking for. The python versatility is something to learn more.

Hi,
I am trying to Set dimension override value with multiple segments. I know there are nodes for each override value. I am trying to combine all the override to one python script. The problem is that when I list them (python script) they don’t change all of the set value except for the first set value

"
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
items = UnwrapElement(IN[0])
ovr = IN[1]
abv = IN[2]
bel = IN[3]
pre = IN[4]
suf = IN[5]
goodlist = list()
badlist = list()
counter = 0

TransactionManager.Instance.EnsureInTransaction(doc)

while counter < len(items):
    try:
        items[counter].ValueOverride = ovr[counter]
        items[counter].Above = abv[counter]
        items[counter].Below = bel[counter]
        items[counter].Prefix = pre[counter]
        items[counter].Suffix = suf[counter]
        goodlist.append(items[counter])
    except:
        badlist.append(items[counter])
        counter += 1

TransactionManager.Instance.TransactionTaskDone()

OUT = (goodlist,badlist)
"

So for the above script the “items[counter].ValueOverride = ovr[counter]” set but not the other.

Can you format your python code correctly? Highlight all of the code and use the </> button, and double check all quotes/indents so that we can see the actual code.