Sorry if the translation is wrong
Thank you as always
I have a question about how to split rebar from a selected face.
I would like to split the rebar that intersects with the surface as follows,
The standard cut function in Revit doesn’t work, so I’m wondering if I can do it with Dynamo. I saw a similar question before, so I tried to create a Dynamo based on that, but it didn’t work.
I don’t know what to do next, so I’d appreciate any advice.
I’m a beginner to both Revit and Dynamo so this may be a basic question but any help would be much appreciated.
Split rebar in selected columns.dyn (25.1 KB)
Rule of thumb.
If you can’t do it in Revit you can’t do it wit Dynamo.
Maybe you can re model them using Dynamo
though (from intersection to intersection) and delete the old ones afterwards.
Thank you for your reply.
I’m sorry, but I didn’t quite understand the part about renovating (from intersection to intersection) and delete the old ones afterwards.
If splitting is not possible, I would at least like to shorten the rebar that extends from the inside of the pillar to the column surface. Is this possible?
Your rebar intersect the column (two times) and have start and endpoints.
You can use those points to re model the rebar
so you end up with basically split rebar (three sets of three).
You only need to delete the old ones afterwards
as you don’t need that one anymore
I think I understand it somehow.
Is the procedure as follows?
-
Select the column
-
Extract the column position (curve)
-
Find the coordinates of the start and end points of the curve
-
Place the rebar within the calculated coordinates?
-
Delete the rebar that was originally placed?
Is this correct?
I see the process that in a different way, but without knowing how you have modeled this to begin with it’s hard to know if this is best or not.
- Extract the rebar curves
- Extract the solids from the walls and column
- Convert the solids to surfaces (explode)
- Generate a polysurface from the many surfaces
- Split all the curves by the polysurfaces
- Trim, extend, and offset the curves as desired for construction methods
- Build a new rebar from each of the curves (may have to collect the host, perhaps using the center point of each curve)
- Delete the original rebar
2 Likes
hi
import sys
import clr
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
r=UnwrapElement(IN[0])
l=r.GetCenterlineCurves(0,0,0,0,0)[0].ToProtoType()
OUT = l
edit:Then have a package that creates rebars from curves
edit2 too late
with M. Jacob protocole
more faster
cordially
christian.stan
4 Likes
Thank you!
This is my first time using Python Script, so I don’t really understand what’s written, but I’ll take this opportunity to learn more.
By the way, when I was selecting rebar, I wanted to select multiple items, so I changed it to “Select Model Elements,” but an error occurred. How can I fix this?
1 Like
Hi, I did it with a single bar for the example.
Here’s a more complete example if the bar isn’t straight.
Python script
import sys
import clr
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
elts=UnwrapElement(IN[0])
def transform_on_list(elt):
if type(elt)==list:
return elt
else:
return [elt]
def obtain_curves(r):
if r.Category.Id == ElementId(BuiltInCategory.OST_Rebar):
l=len(r.GetCenterlineCurves(0,0,0,0,0))
return [r.GetCenterlineCurves(0,0,0,0,0)[i].ToProtoType() for i in range(l)]
else:
return "Not a rebar"
elts=transform_on_list(elts)
OUT = [obtain_curves(e) for e in elts]
edit: As you were sending a list, the GetCenterlineCurves method applies to an element of a list and not to an entire list, here is your error message
Sincerely,
christian.stan
Thank you for your easy-to-understand explanations.
I tried to create a polyline and place rebar using the method you taught me, but it didn’t work. (Rebar split2.dyn)
I was able to split the polyline into an ideal shape using the method you taught me before, but I couldn’t place the rebar. (Rebar split.dyn)
I’m sorry for asking multiple questions, but could you tell me what the problem is?
It may be difficult to understand since the language is different, but I have enclosed the Revit data.
Thank you in advance.
Rebar split.dyn (31.1 KB)
Rebar split2.dyn (30.7 KB)
sample_structure.7z (8.8 MB)
1 Like
Hi, here’s your script. I hope this answers the original question.
Creating the rebar is another topic.
Sincerely,
Christian.stan
Thank you!
Sorry, I misunderstood a little. I thought I needed to get the intersection of the column and the rebar and then remodel the rebar from there.
The method you taught me doesn’t seem to allow me to split at the intersection. Is it difficult to split with “Geometry.Split”?
Or do I need to install some kind of package?
Hi, no split has always worked for me.
Sincerely,
Christian.stan