Hello,
Free form rebar is a curve driven type of rebar ( as opposed to shape driven rebar ), which means you cannot simply select a shape and assign to it. But if the curves are planar, the free form rebar can be matched to existing shapes.
In order to enable shape matching for free form rebar you have to set the Workshop Instructions parameter to “Bend” ( as shown in attached image ).
From the API you can set it the following way:
Rebar myRebar; // this is the rebar created by “CreateFreeForm” method
// I will skip the validation part ( exception catch, null checks, etc )
RebarFreeFormAccessor freeFormAccessor = myRebar.GetFreeFormAccessor();
using (Transaction t = new Transaction(YourRevitDocument, "Set free form to bent"))
{
t.Start();
freeFormAccessor.WorkshopInstructions = RebarWorkInstructions.Bent;
t.Commit();
}
Also, it’s worth mentioning that a Free Form rebar can have multiple shapes ( each individual bar in the Rebar set can have its own shape).
As for the layout, because you are inputting the curves for each bar in the rebar set, we can only set it to Fixed Number and it will be read-only. If you want to change the spacing between the bars you have to update the curves into the new position.