Split multiple Beams from Array Points

Hi. I want to split mutibeam at multiple points. Can you help me ?

Thanks a lot !!!

Hi @trungdung06n1 …if you want to use custom nodes then try this one here from Genius Loci…i know my example is on duct but should work on beam as well…

Hi. I want to split Beam at Point on Beam. Can you help me? Many thanks.

Vào Th 3, 9 thg 8, 2022 vào lúc 22:25 Søren Villadsen via Dynamo <notifications@dynamobim.discoursemail.com> đã viết:


Hi. I want to split Beam at Point on Beam. Can you help me? Many thanks.

1 Like

Yes no worries :wink: could you share your rvt with these 4 beams…and your graph…arh i see you are new user so just share over webtrans or whatever and give the link here…Btw welcome here :wink:

1 Like

I am using Revit 2023 version.do you use it?

This is my Dynamo .

Allright try something here…could probably work for you…

Revit_oInn0O4EoJ

4 Likes

Hey @sovitek
i’m looking for point coordinates, not point distances.

Not sure whats goin on are you try to split in a clash point…i just try to show a rough example how you can split, and there are many ways to generate point i just do it fast that way…but good luck with that :wink:

1 Like

Can you repair code @c.poupin ? thank many many

Code for multiple beam

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
import Autodesk
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
doc = DocumentManager.Instance.CurrentDBDocument

def splitBeam(elem, lstPt):
	curvB = elem.Location.Curve
	#sort by distance with end point of Curve
	lstPt.sort(key = lambda x : curvB.GetEndPoint(1).DistanceTo(x))
	outBeam = []
	TransactionManager.Instance.EnsureInTransaction(doc)
	beam.Pinned = False # unlock for beam system
	doc.Regenerate()
	for pt in lstPt:
		lenBeam = curvB.Length 
		param = (curvB.GetEndPoint(0).DistanceTo(pt)) / lenBeam
		newBeamId = elem.Split(param)
		outBeam.append(doc.GetElement(newBeamId))
		doc.Regenerate()
	TransactionManager.Instance.TransactionTaskDone()   
	return  outBeam, lstPt, curvB.GetEndPoint(0).ToPoint()
	
	
toList = lambda x : x if hasattr(x, '__iter__') else [x]

lst_beam = toList(UnwrapElement(IN[0]))
array_array_DynPt = IN[1]
out = [] 
for beam, lstDynPt in zip(lst_beam, array_array_DynPt):
	#convert dynamo points to Revit Point
	lstPt = [x.ToXyz() if isinstance(x, Autodesk.DesignScript.Geometry.Point) else x for x in lstDynPt]
	loc = beam.Location
	if isinstance(loc, LocationCurve):
		outBeam , lstPt, startPt = splitBeam(beam, lstPt)
		out.append(outBeam)
OUT = out
3 Likes

I used Point coordinates, not point distances. hic

the script has as input a list of beams and an array of array of points (as the @sovitek 's solution), the Curve.PointAtParameter node is just an example to generate points easier.

you need to group your clash intersection points per beam

3 Likes

@c.poupin @sovitek Hi.
thank you very much. I’ve done it. thank you once again !

by this method i couldnt run python script. But i combine this one and the @sovitek 's approach. It works when i try to divide multiple beams by only 1 beam. if there’s 2 more beams to cut with script dont cut all of the ones.



Split Frames.dyn (49.2 KB)