How Should I Understand 'RebarHookOrientation' at rebar hook.

How Should I Understand 'RebarHookOrientation' at rebar hook.

qoreodlf37
Enthusiast Enthusiast
143 Views
1 Reply
Message 1 of 2

How Should I Understand 'RebarHookOrientation' at rebar hook.

qoreodlf37
Enthusiast
Enthusiast

Hi, I have a question about RebarHookOrientation ar rebar hook.

https://www.revitapidocs.com/2024/e8365754-0811-8d4e-864a-55bf34af3a87.htm
This is docs about RebarHookOrientation.

 

 

I'm trying to create freeform rebar using this code;

Rebar newRebar = Rebar.CreateFreeForm(doc, rebarType, host, curveList, out var err);
newRebar.SetHookTypeId(0, startHook.Id);
newRebar.SetHookTypeId(1, endHook.Id);
newRebar.SetHookOrientation(0, RebarHookOrientation.Left);
newRebar.SetHookOrientation(1, RebarHookOrientation.Left);

 

As I understand it, the hook is oriented to the left side relative to the direction of the curve, as shown in the image below.

qoreodlf37_0-1749713593707.png

 

 

But if rebar curve is Arc shape or when the lines are connected, It seems that the hook orientation is not determined by the direction of the line, but rather by the convex part of the rebar shape.

qoreodlf37_0-1749714893683.png

 


Is my understanding of the RebarHookOrientation rule correct?
If there’s a detailed explanation or documentation available, please share the link.
Thank you all!

 

0 Likes
Accepted solutions (1)
144 Views
1 Reply
Reply (1)
Message 2 of 2

longt61
Advocate
Advocate
Accepted solution

Your understanding is partially correct. One rebar shape can have multiple segments, for example: an U-shape rebar has 3 segments, an L-shape rebar has 2 segments, etc.. The direction of rebar hook is determined by:
1. the direction of the start, or the end, segment. This segment direction conforms to the overall rebar direction
2. the normal vector of the rebar plane. This normal vector can be used to determine the direction to "duplicate" rebar when you switch rebar layout rule from "Single" other rule.

The right vector is the result of cross product of segment direction and normal vector, conforming to the right hand rule. Any hooks on the side of the right vector is considered right-sided, and vice versa. 

you can see my answer here for the better explanation.

Depending on whether the normal vector is pointing at your face or pointing away, the hook direction in your images could be right or wrong. 

Hope this helps

0 Likes