Modify a length parameter to the entire bar category

Translated by moderator. See below the line for original post.


Revit has a way of calculating the total length of a bar… which is by tangents. The problem is that when it calculates it, it does not take into account the development length of the curve of the shape of the bar, so the total length values ​​are not as expected. Example = I have an L-shaped bar in which one segment measures 1 mt and the other measures 0.50. At the time of having its total length, the expected is 1.5m, but it turns out that Revit returns 1.47… it is always less than expected and this length causes my values ​​of quantities, weight, volume, length to vary.
What I did to solve this problem was the following:

a script that would allow me to select an object
extract the parameters a, b, c, d, f, g
filter the empty elements to omit them in the total sum
add them and generate this value to insert it into a length parameter previously created in Revit for the rebar family
it works. I try to modify the script so that it does those steps for the entire category or multiple elements at once, but it does not work. the values ​​of one specimen to another are combined but I have not been able to do so


Original post below.


Revit tiene una forma de calcular la longitud total de una barra… que es por tangentes el problema es que cuando lo calcula no tiene en cuenta la longitud de desarrollo de la curva de las forma que tenga la barra, al ser así los valores de longitud total no son los esperados ejemplo = tengo una barra con forma de L el cual un segmento mide 1 mt y el otro mide 0.50 al momento de tener su longitud total lo esperado es 1.5m pero resulta que Revit arroja 1.47… siempre es menor a lo esperado y esta longitud hace variar mis valores de cantidades, peso, volumen, longitud
lo que hice para solucionar este problema fue lo siguiente

un scrip que me permitiera seleccionar un objeto
extraer los parámetros a,b,c,d,f,g
filtrar los elementos vacíos para omitirlos en la suma total
sumarlos y generar este valor para insertarlo en un parámetro de longitud creado en Revit previamente para la familia de armaduras
funciona trato de modificar el scrip para que haga esos pasos para toda la categoría o múltiples elementos a la vez pero que no se combinen los valores de un ejemplar a otro pero no he conseguido hacerlo

Welcome to the forum @Harold_Jimenez. :smiley:

Sadly the official forum language is English, which is a requirement to make search work (annars skulle jag bara skriva på svenska för att få in min träning). Please translate future posts to English, optionally keeping your native language post separated by a demarcation line to help should we ever get technology to enable multi-language search.

Me recollection is that Revit uses the curve length accounting for the radius on the bend rather than the ‘straight line length’. What is the need for the straight line length?

1 Like

THE NEED APPLIES AT THE TIME OF CARRYING OUT CALCULATION OF QUANTITIES OF STEEL AND WORK DRAWINGS. SINCE WHEN PLACING ORDERS FOR STEEL, THE TOTAL LENGTH OF THE SUM OF THE PARAMETERS A-B-C-D-E-F-G OF THE FORM IS REQUESTED WITHOUT SUBTRACTING THE CURVE LENGTHS
What I did to solve this problem was the following

I created a script that allows me to select a goal
extract the parameters a,b,c,d,f,g
filter empty elements to skip them in the total sum
add them and generate this value to insert it into a length parameter previously created in Revit for the reinforcement family]

The script works per element but I try to modify the script so that it does these steps for the entire category or for multiple elements at the same time but that the values ​​are not combined from one example to another

Never heard of rebar quantification being processed like that, seems it would result in buying extra length of rebar, but everywhere is a bit different.

What have you tried so far? What error messages do you get from that? Are you doing this with nodes or Python or C# or…

We understand your goal, but to help you find your way there we need a better indication of where you are right now.

So far I made a script from preset nodes in dynamo and camber that performs the following steps

1- I select the object in the model.

2- I get the element parameters by filtering the parameters a,b,c,d,e,f,g and omit
Empty or null parameters.

4- I add the values ​​to an addition operation

5-I overwrite a length parameter with the value that gives me the sum I made in the previous node

(this parameter; it is a parameter I previously created before running that script, with a custom name)

These steps in the script I made work for the goal I need…

The goal I’m looking for now is that these steps are performed on all the elements of the category simultaneously without combining the values ​​of all the elements…

I could send you the dyn file so you can analyze it, but for now it won’t let me upload it directly. If you allow me, I can send it to your email so that you can share it in this forum so that other people can see it.

Updated your trust level so you can post here now.

If you still can’t get it to work after giving it a few minutes, try clearing your browser cache or use a 3rd party service with open access such as dropbox, box, google drive, onedrive, wetransfer, etc.

tabla de aceros.dyn (30.3 KB)

I don’t speak English and I notice that when I write something the translator interprets it with grammatical errors…

The truth is that I think this script that I created is very simple and serves the need that I present… but being element by element it is somewhat tedious.

That’s why I want the script to perform this process for the entire category simultaneously.

1 Like

Don’t you want to select multiple elements?

Yes, that is exactly what I want, to be able to select multiple elements but when I do the process that I indicate it combines the values ​​of one element with another and generates an incorrect value

That is why I am looking for a way to do it simultaneously to all the elements, generating the values ​​that correspond to each element.

You will need to utilize lacing and levels to handle the data separately. This post may help you with that. If not, search the forum or online about that topic.

I’m applying what it says in the thread you mention but I get into the loop where I don’t know how to get the parameters separately from each element, add the values ​​separately from each element and add them to the custom parameter separately…

I SHARE WITH YOU WHAT I HAVE DONE… I HAVE AN ERROR IN THE FIRST PYTON SCRIPT AND IT IS SUPPOSED TO CALL THE VALUES OF THE INDICATED PARAMETER AND IT THROWS ME A VALUE THAT DOES NOT CORRESPOND TO THE ELEMENT

Not sure why you are using the Set Parameter node like you have, but that is what is causing the error. You are not feeding in a value, so that node is failing by returning “Function” and not passing along the elements to the rest of the nodes. When troubleshooting errors, you have to start with the node that is returning the error and backtrack from there. 9 times out of 10 errors are caused by a node failing prior to the error. Remove the Set Parameter node and feed the element list directly into the Get Parameter node. The Get Parameter node may automatically apply the lacing/levels.