Message 1 of 13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I tried to create beam’s rebar using Revit API, but I get Hook orientation opposed only when shoosing 90° value!!?..can anyone explain me the reason for that?
Remark: I'm working with Python and Dynamo
Here my graph:
Check my code please:
import sys
import clr
import math
from System.Collections.Generic import IList, List
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
curve = IN[0].ToRevitType()
bar_type = UnwrapElement(IN[1])
ber_Hook_type = UnwrapElement(IN[6])
host = UnwrapElement(IN[3])
vect = IN[2].ToRevitType()
beam_width = IN[4].ToRevitType()
width = beam_width.Length
cover = IN[5]/0.3048
spacing = 0.10/0.3048
curv = List[Curve]()
curv.Add(curve)
TransactionManager.Instance.EnsureInTransaction(doc)
rebar = Rebar.CreateFromCurves(doc, RebarStyle.Standard, bar_type, ber_Hook_type, ber_Hook_type, host, vect, curv, RebarHookOrientation.Left, RebarHookOrientation.Right, True, False)
rebar.GetShapeDrivenAccessor().SetLayoutAsFixedNumber(math.ceil((width-2*cover)/spacing), width-2*cover, True, True, True)
TransactionManager.Instance.TransactionTaskDone()
OUT= rebar
Could anyone help me ?
Thanks.
Solved! Go to Solution.