I want to split elements by points. For instance I’ll do a brep curve intersection, find intersection points and use those points to split columns. I see there is a method in API and tried to create my own node in Python but failed miserably. maybe @eirannejad or @japhy can create a quick node and help me
I can take stab at this weekend, few other issues in the queue to get through first. Getting hung up on the recursion aspect? Were you able split just one via api?
Ok, so I have done it for a single element. @japhy can I ask for a resource that explains how to use Grasshopper trees in Python? I always struggle in that part.
The recursion part is tricky, you have multiple points on a single column. The first one splits then you have a new element ID and essentially have to start over by testing if the point is inside the brep, then split that column.
you really want to do that all in grasshopper and then send to the python component 1 Element, 1 normalized curve parameter.
Hmm, I think thats why I dont get the result I create in Rhino. Looks like simply deleting and recreating elements is a lot faster. But I’ll try to do it anyway.
Keen to use a RIR components to split Revit Elements -
Keen to split Structural Framing elements Fixed to a Reference Plane.
Cause if we recreate the beams, you will lose the connection to the Reference plane that it was attached to. Also, can’t create structural framing to a reference plane.
import Rhino
# for accesssing GH classes
from Grasshopper.Kernel.Data import GH_Path
from Grasshopper import DataTree
from System import Array as array
layerTree = DataTree[object]() # make a DataTree
for i in range(len(layernames)):
objs = Rhino.RhinoDoc.ActiveDoc.Objects.FindByLayer(layernames[i])
if objs:
geoms = [obj.Geometry for obj in objs]
path = GH_Path(array[int]([0, 0, i]))
layerTree.AddRange(geoms, path)
a = layerTree
That particular method says “Splitting is permitted for architectural and structural columns, beams and braces. Beams and braces that are not a line or an arc is not permitted”
I applied a fix in python 3 for Rhino 8.5 that allows using pythons object as a generic argument so a script like this does not throw error and we don’t have to use DataTree[System.Object]