Modify area reinforcement boundary

Hi guys,

I am working with create area reinforcement node from BIM4Struct Package and everything is fine,
but this node only creates area reinforcement along the whole floor or wall. The question is can we specify the boundary of the area reinforcement or if we have an existing area reinforcement can we modify its boundary?

Thanks

Hi @ali.safiaddine

There is a method in the API that allows to specify boundaries for the reinforced area :

I just had to make a minor change to the AreaReinforcement.CreateFromHost node from BIM4STRUCT to add the possibility to define the outline :

#creating curve array for outline:
l = [i.ToRevitType(True) for i in IN[4]]
crvarray = List[Curve](l)  

then

#addition of the array to the args when calling the method accordingly to API:
rebar = AreaReinforcement.Create(doc, host,crvarray, majorDirection, defaultAreaReinforcementTypeId, bartype.Id, HookTypeId).ToDSType(new)

you can replace the code in this node (inside the custom node):

with the following code:

#Create area reinforcement in a Floor ro Wall
#Authored by Dieter Vermeulen, Autodesk, 2016
#http://revitbeyondbim.wordpress.com

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference("System")
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
host = UnwrapElement(IN[0])
bartype = UnwrapElement(IN[1])
vector=IN[2]
#Toggle that indicates if a new element has to be created
new=IN[3]
#creating curve array for outline:
l = [i.ToRevitType(True) for i in IN[4]]
crvarray = List[Curve](l)
TransactionManager.Instance.EnsureInTransaction(doc)
# Get the host analytical profile whose curves will define the boundary of the the area reinforcement 
analytical = host.GetAnalyticalModel()
if not analytical:
    rebar= "The selected element can't \nhost Area Reinforcement"

else:  	
	#define the Major Direction of AreaReinforcement,
	#if there is no Major Direction given in the inputs, then take the direction of the first curve of the floor/wall sketch.
	if vector is None:
		curves = analytical.GetCurves(AnalyticalCurveType.ActiveCurves)
		firstLine = curves[0]
		majorDirection = XYZ(
	    	firstLine.GetEndPoint(1).X - firstLine.GetEndPoint(0).X,
	    	firstLine.GetEndPoint(1).Y - firstLine.GetEndPoint(0).Y,
	    	firstLine.GetEndPoint(1).Z - firstLine.GetEndPoint(0).Z)
	#else use the given vector
	else:
		majorDirection=vector.ToXyz()

	#Obtain the default Area Reinforcement Type
	defaultAreaReinforcementTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.AreaReinforcementType)
	if str(defaultAreaReinforcementTypeId) == "-1":
		rebar= "There is no Area Reinforcement Family Type \ndefined in the Revit project"
	else:
		#Set the default Hook Type to none
		HookTypeId = ElementId.InvalidElementId
		try:
			rebar = AreaReinforcement.Create(doc, host,crvarray, majorDirection, defaultAreaReinforcementTypeId, bartype.Id, HookTypeId).ToDSType(new)
		except:
			rebar= "The Area Reinforcement could \nnot be created"

#Assign your output to the OUT variable

TransactionManager.Instance.TransactionTaskDone()

OUT=rebar

and add an input :

I suggest that you save the custom node under a new name …

here’s the result you should have:

3 Likes

thank you :slight_smile:

@ali.safiaddine
Hello,i know the topic is old but can someone tell me what is the input for the boundary.I am trying to achieve area reinforcement only above the inside columns of a concrete slab

Hi @Eng.Aykov ,
the input is a list of curves (the perimeter curves for the area you wish to create reinforcement in)

Hi @Mostafa_El_Ayoubi
Thanks for the quick reply.It works brilliant

1 Like

Hello! I need to create a reinforcement on the area with the cut out section (two rectangles; one in the other).

___ I tried to add successively the lines of the external and internal contours - it does not work. The CurveArrArray method is not picked up here …

Hi @Mostafa_El_Ayoubi,

Sorry for my question in your long ago post , recently , i have been trying to to create the rebar by using your package … but i could not able to crate the area reinforcement (refer to the attached) … can you please advise…
thanks in advanced.