Problem with hook rotation when using Rebar.CreateFreeForm

Anonymous

Problem with hook rotation when using Rebar.CreateFreeForm

Anonymous
Not applicable

Hello,

I've been creating rebars with Rebar.CreateFreeForm and everything works great when I create a bar with 2 points, however when I try to create rebars with more than 2 points I can't control the hook bar rotation, some hooks are set correctly but others are not, even when they have the same hook type and rotation, as shown below:

 

hookCorrect.PNGhookWrong.PNG

I've being trying to compare all parameters and they are pretty much the same for both bars, and I'm not sure what the problem is.

 

Thanks in advance.

0 Likes
Reply
Accepted solutions (1)
626 Views
1 Reply
Reply (1)

Anonymous
Not applicable
Accepted solution

I solved it already.

Instead of using the constructor 

 

public static Rebar CreateFreeForm(
	Document doc,
	RebarBarType barType,
	Element host,
	IList<IList<Curve>> curves,
	out RebarFreeFormValidationResult error
)

And getting and setting hook parameters like type and rotation (Where hook orientation seemed to change based on rebar coordinates.)

 

I used this contructor instead, which usesRebarHookOrientation startHookOrientRebarHookOrientation endHookOrient, and solves the problem.

 

public static Rebar CreateFromCurves(
	Document doc,
	RebarStyle style,
	RebarBarType barType,
	RebarHookType startHook,
	RebarHookType endHook,
	Element host,
	XYZ norm,
	IList<Curve> curves,
	RebarHookOrientation startHookOrient,
	RebarHookOrientation endHookOrient,
	bool useExistingShapeIfPossible,
	bool createNewShape

Hope it helps somebody with the same problem.

 

0 Likes