Create Area Reinforcement by boundary

Create Area Reinforcement by boundary

office
Enthusiast Enthusiast
1,298 Views
1 Reply
Message 1 of 2

Create Area Reinforcement by boundary

office
Enthusiast
Enthusiast

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

 

 

 

 

0 Likes
1,299 Views
1 Reply
Reply (1)
Message 2 of 2

mikako_harada
Community Manager
Community Manager

Hi Koppevi, 

 

I'm not familiar with Dynamo. And I think it's the same for majority of audience here. But since I do not see a reply, a few suggestions:

 

1. try posting to dynamo discussion forum: 

http://dynamobim.com/forums/forum/dyn/

 

2. one suspect is the type of host. make sure you are setting structure wall as a host.

 

3. if you can reproduce using C#, by modifying the SDK sample or something, we have more people who can take a look.

 

Sorry for not being much help.   


Mikako Harada
Developer Technical Services
0 Likes