Path Reinforcement


#1

Hi

I Have a question.
In the BIM4Struc.Rebar package there is a node AreaReinforcement.CreateFromHost. Is it possible to create a similar node for PathReinforcement? A node that places reinforcement on the edge of floors and walls?


#2

Yes it’s possible, here is the documentation:

http://www.revitapidocs.com/2017/fb317cdc-63ec-3c9b-b7df-087d729fb52e.htm


#3

Thank you for your reply. But I don’t have experience with python/code, could you help me with this?


#4

Sure! After some basic python tutorials I recommend that you read this: https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#revitapi

Maybe after that look at this: Dividing parts with dynamo

Then look at the node from bim4struc and see if you can replace the area method with the path method.


#5

Einar,

I’m reading the links. I will let you know in a few days what i came up with.


#6

Einar.

I tried to make a script. and this is the result

What i want is to imput a host (floor or wall) and take the edges to place my path reinforcement.
This is the script used in the area reinforcement node. There are still unnecessary my script but i want to delete them later.

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
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

#Preparing input from dynamo to revit
host = UnwrapElement(IN[0])
curve = UnwrapElement(IN[1])
flip = UnwrapElement(IN[2])
bartype = UnwrapElement(IN[3])
hooktype = UnwrapElement(IN[4])

# Get the host analytical profile whose curves will define the boundary of the the path reinforcement 
analytical = host.GetAnalyticalModel()

#All actions that makes changes to the Revit database needs to be inside a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

#Path
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 curve is None:
		curves = analytical.GetCurves(AnalyticalCurveType.ActiveCurves)
		
#Obtain the default Path Reinforcement Type
defaultPathReinforcementTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.PathReinforcementType)
defaultRebarBarTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.RebarBarType)
defaultHookTypeId = doc.GetDefaultElementTypeId
	
rebar = PathReinforcement.Create(doc, host, curve, flip, defaultPathReinforcementTypeId, bartype.Id, hooktype.Id, hooktype.Id).ToDSType();

#Assign your output to the OUT variable

TransactionManager.Instance.TransactionTaskDone()

OUT=rebar

But it isn’t working and i don’t know why.


#7

Hello, could you format the code like shown here, then I can copy/paste and test it for you:


#8

Is this better?


#9

A lot better, but I could not get it to work either. But here is a minimum working code that you can work with. I had to remove one of the curves in the curveloop because it would not accept a closed loop:

import clr

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

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI 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
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
host = UnwrapElement(IN[0])
rebarBarType = UnwrapElement(IN[1])
rebarHookType = UnwrapElement(IN[2])

if rebarHookType:
	rebarHookTypeId = rebarHookType.Id
else:
	rebarHookTypeId = ElementId.InvalidElementId
analytical = host.GetAnalyticalModel()
curveArray = analytical.GetCurves(AnalyticalCurveType.ActiveCurves)
curveArray.RemoveAt(0)

flip = True

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
pathReinforcementTypeId = PathReinforcementType.CreateDefaultPathReinforcementType(doc)
rebar = PathReinforcement.Create(doc,host,curveArray,flip,pathReinforcementTypeId,rebarBarType.Id,rebarHookTypeId,rebarHookTypeId)
TransactionManager.Instance.TransactionTaskDone()

OUT = 0

#10

Thnx for the script.
I see that you are removing the first curve. Is it possible to leave this one curve and not join them (not contiguous)? So that every edge generate an single (10 edges see image) path reinforcement.
When have a wall/ floor with an opening I get a error (see image)


With the opening i get more edges. (10 edges in this floor)


#11

@Einar_Raknes Thnx for your help!
Dieter Vermeulen has an update on the Bim4Struc package in now contains a node “Path Reinforcement”


#12

of course,ACM panel plays an important role in green building,why not try?