Good day,
I am looking for a way to set the parameters of a free form rebar before it is created.
After a method executes, I cannot select a shape or layout parameters. What I know is that it takes default rebar shape from rebar shape browser. Probably it does the same with layout rules etc.
Is there a way to set these properties before creating free form rebar?
Sincerely,
Solved! Go to Solution.
Solved by vlad_berila. Go to Solution.
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.
Thank You for Your response.
It truly helped me to get a better understanding of a free form rebar.
However, I still need to create a rebar of a desired shape. I am thinking of creating a dummy rebar with a desired shape and see if it will be set as a default shape for a free form rebar
Hello,
It would help me to get a better understanding of your issue if you could tell me what are you trying to reinforce in this way and why do you need to use free form rebar?
Thanks for your help. I can send a test revit file and my code if needed. In brief:
1. We have 2 or more structural foundations
2. User draws a simple detail line
3. Code reads the surfaces and creates transforms of this line on its surface
4. Creates free form rebar
My code does almost all of the things I listed. Just need to find a way to set rebar shape when creating free form rebar 🙂
Thank you for the explanation,
From what I see in the images I think that you can use a shape-driven rebar. There is a method for creating a shape driven rebar called CreateFromCurvesAndShape in which you can input both the curves and the shape. Does this help?
Unfortunately, I did not work for me but maybe I used it in a wrong way
1. I specify RebarhookType as null cause I dont need them
2. XYZ norm is host normal?
3. IList<Curve> are the curves I got (in sample case 3 lines)
Result I get is as follows:
Hello,
1. It's ok to pass null if you don't need hooks
2. It's the normal of the bar plane. The bar plane is the plane in which the rebar curves lies and bend. The normal it's also the direction in which the rebar set expands.
Regarding the error, it seems that your curve loop does not match the shape you are trying to set for the rebar. They must match. For example you cannot set a straight line shape ( shape 00 for example ) and a curve loop consisting of 2 curves ( L bar for example ). Also if the hooks are included in shape definition ( the ReinforcementSettings option ) and your shape defines hooks, for the shape to match the curves it should also match the hooks. Can you double check your shape?
Thank You for clearance. The thing is that I have a task to create a "00" type rebar (straight) which is not in reality straight (like in previous 3d picture). Customer told me, that it is a normal practice for them to put that type of bar between 2 or more structural with a slope as in sample.
The aim is to have only one parameter A with value, which is why they request to do that with "00" type.
Furthermore, we need the rebar ends not to touch the ends of structural foundation, that is why I use a detail line.
Probably "createfromcurvesandshape" method is not suitable for me because I need the rebar to look bent.
Seems like we are back to the beginning 😀.
You described exactly the behavior of a free form rebar with the WorkshopInstructions parameter set to Keep Straight. When you have that you can bend the rebar in any way you like and the shape will report a straight shape with only one parameter. This doesn't solve your problem? It's the CreateFreeForm method that you described.
I just have to apologise for my incompetence in structural Revit.
After I change workshop instructions, I cannot find a way to change a shape for any rebar, parameters are set to "read-only". Can You guide me to a right path?
Good morning,
When the workshop instructions for a free form rebar are set to Keep Straight ( API : RebarWorkInstructions.Straight ), the system will automatically set a straight shape in the free form rebar ( a shape defined only by a straight line, reporting only one parameter which is the total length ), no matter how complicated the rebar curves are. Do you also need to change this straight shape to another straight shape? You cannot change it for now.
If I have for example 5 types of straight shapes (maybe duplicates with different name), does it mean that I cannot change to any of those? In this case I need a straight one, but I just cannot find a way to choose between those 5 types.
Unfortunately for now you cannot change between shapes for a free form rebar.
Is there any way to change the rebar shape property of a free form after the creation. Maybe I can to select one of these 5 shapes before the creation of a free form and Revit decides to use it for a creation. I think I know, that the last user defined straight rebar shape from the rebar browser will be used in free form rebar creation
There's no guarantee, the system gets the first straight shape that it finds in the document or creates one if no one is available.
Well, I thought of an interesting approach and got slapped once again.
I open another revit document (donor project), do the free form rebars with only one shape available (it works fine and smooth) but when I copy them back to my main document, Revit itself renames copied rebar shape, for example:
if it was "00" in donor and main document has "00" shape already, it renames copied rebar shape to "00 01". It's killing me already.
I saw today that someone is still reading this.
I found an easy workaround. I rename the desired rebar type to a name that starts with first ASCII letters. In my case its a symbol "!". When you create free form rebar, it takes first rebar type in the list and its with a name "!". Then I rename it back. Case closed
Can't find what you're looking for? Ask the community or share your knowledge.