Dimension of beams

Hi everyone,

Does anyone know How to change the “read only” parameters in dynamo?
I would like to set an equal cut length for all my beams

Likely Element.SetLocation is the closest you will get.

Read only parameters are just that - read only. Once set they cannot be altered without recreating the element/parameter.

Thank you for your answer.
I’m actually creating a grid of beams on dynamo from a grid of points. The length of the lines I use is the same for the whole grid.
But the cut lengths in Revit are different.
Is there any way to avoid that?

Not sure - may be how they are joining creating the issue. Can you share the dyn?

Might want to try creating all the horizontal, then all the vertical, then all the up left diagonals, then the up right diagonals, etc. that may result in a consistent join condition and therefore a consistent length.

Here is a simplier example


“segment” is a function that creates lines beatween a list of points. (first to second, second to third, etc)

I would like the beams to end at the red lines.
image
I could use the extension option but first, I need the cut length to equal the length. Or at list a same length for all my beam.

dyn1.dyn (33.5 KB)

Here is a simple dyn to deal with this problem.

Can’t open that file at the moment, but…

This is Revit being smart, which usually you want. Your beams are using the same point for their adjacent start and endpoints. Two beams cannot occupy the same space, and Revit knows that likely you want them to join somehow.

Instead, shift start and end points of each line the points by a known distance (say 1 unit) into the line, and set the locations from there.

I can’t shift the start point and end point as I am using the model for calculation then.
I integrate the model to Robot and then to Revit, so unfortunately no non structural trick can’t be used here.

Shift them by the same distance you’re looking to adjust them so they’re the same length.

Two objects cannot occupy the same space, so something has to sit at the hub, but all four cannot be the “something,” so one of the parts have to change. If not that, perhaps adjust the spacing of the grid to accommodate for the connection/non-connection condition of each beam.

Thanks for aswering, but I Think i’m not precise enough for you to understand my issue.
I am drawing a metal frame using dynamo. I have thousands of beams.
The metal frame is divided into 2 grids and connections in between (which are beams as well).
I need the analytical model to be exact in order to use it for calculation then. Then neither the spacing of the grid, nor the start point/end point can be change.
I would like the beams to be drawn the same way in revit. That is to say that no beam occupies the hub.
As I cannot move the analytical lines, I would like to change the display of the beam using the revit parameters. As I’m working with dynamo creating thousands of beams, I guess that the way to do that is to change the parameters for a group of beams. But, for a single group, beams have different cut length, and the same length. Then I cannot use the parameter “extension” for my group of beams, because the displayed length is miscellaneous.
Hence my issue.
I am surprise that drawing a metal frame in dynamo is such a big issue so I still belive there is a way to draw beams that behave properly.
The question is how ? :slight_smile:

Precision o fthe question may have been part of the issue. That last paragraph made it click for me. You’re not looking for the beam length, but the cut length, which is a function of the length, the start extension and the end extension…

If you were to do this by hand, you’d first draw the beam from point to point, then adjust the start extension and end extension as needed, right?

When working though Dynamo, it’s usually best to work in the same way.

So we need to tell Dynamo to do the same: draw the beam, set the extensions, and check the lengths.

Notice the first List.Unique items has multiple results, but that the discrepancy is somewhere beyond 13 decimal places of accuracy… or in real world terms, 0.

Yes that’s what I meant when I was speaking about “the extension option”.
Your example works well at a first sight, however I Don’t understand why the cut length in dynamo and in revit are not the same, see pictures below.



But when you change the extension value, and then execute Dynamo again, the parameter is “read only”.
For what I understand, Revit parameters can be changed or not depending on the generation of the beams.
For my metal framing with thousands of beams in different connected grids, the cut length and the extension parameters cannot always be changed. Hence my issue.
I have tried setting up the extensions and the end joins so Revit could not apply values driven from its proper “intelligency”. But it still doesn’t work properly, especially for non horizontal beams.

Here is what I finally achieved.
If I was to do it by hand, I would actually use the Beam/Column/Joins tool to cut back all my beams.
Here is a python code which I got on a forum, to do that in dynamo :


The code :
"
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import*
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
if isinstance(IN[0],list):
beams = UnwrapElement(IN[0])
else:
beams = [UnwrapElement(IN[0])]

for b in beams:
eu = b.ExtensionUtility
TransactionManager.Instance.EnsureInTransaction(doc)
eu.set_Extended(0,False)
eu.set_Extended(1,False)
TransactionManager.Instance.TransactionTaskDone()
OUT = beams
";

Thank you very much for your help @jacob.small

Cheers