Hi. I want to split mutibeam at multiple points. Can you help me ?
Thanks a lot !!!
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:
Yes no worries 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
I am using Revit 2023 version.do you use it?
Allright try something here…could probably work for you…
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
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
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
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.