Create Area Reinforcement by boundary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i am struggeling with following problem:
i have a given wallgeometry and the definition of an area to reinforce.
the area is either a polyline or a set of lines.
when i use my (python) code based on the api help example i succeed to create reinforcements when i use analytical lines as boundary.
whenever i try another boundary i get that error:
IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File "<string>", line 51, in <module>
Exception: A managed exception was thrown by Revit or by one of its external applications
- as you will see iam working using dynamo and ironpython codes.
the code goes like:
......
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
curves= UnwrapElement(IN[1])
wall=UnwrapElement(IN[0])
mline=curves[0]
wallloc=mline.Location
firstLine=wallloc.Curve
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)
analytical=wall.GetAnalyticalModel()
defaultRebarBarTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.RebarBarType);
defaultAreaReinforcementTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.AreaReinforcementType);
defaultHookTypeId = ElementId.InvalidElementId;
TransactionManager.Instance.EnsureInTransaction(doc)
rein = Autodesk.Revit.DB.Structure.AreaReinforcement.Create(doc, wall, curves, majorDirection, defaultAreaReinforcementTypeId, defaultRebarBarTypeId, defaultHookTypeId);
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable
OUT = rein