Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with hook rotation when using Rebar.CreateFreeForm

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
624 Views, 1 Reply

Problem with hook rotation when using Rebar.CreateFreeForm

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.

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

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.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report