Rebar.CreateFromCurves incorrect shape and host issue

Rebar.CreateFromCurves incorrect shape and host issue

Jusung-Kim
Contributor Contributor
327 Views
4 Replies
Message 1 of 5

Rebar.CreateFromCurves incorrect shape and host issue

Jusung-Kim
Contributor
Contributor

I am creating an L-shaped rebar using Rebar.CreateFromCurves with a Wall as the host.

  • Expected: The rebar should bend outward toward the slab (left image)
  • Actual: The rebar is generated bending inward toward the slab (right image)

Additionally, although I set the host element as the Wall, when moving elements, the rebar behaves as if it is associated with the Slab and moves with it.

The rebar shape is defined using two straight curves forming an L-shape on the same plane. It is created with Standard Style and no hooks.

 

Also, I set the curve coordinates to match the intended shape in the left image, but the resulting rebar is still generated shifted and attached toward the slab as shown in the right image.

 

Is this something that can be resolved?

0 Likes
328 Views
4 Replies
Replies (4)
Message 2 of 5

cvn_imtiaz
Advocate
Advocate

What's problem if do it in section view? Why you need to do in "Create from Curve" ?

0 Likes
Message 3 of 5

Jusung-Kim
Contributor
Contributor

This was not created manually in the section view.
The rebar was generated through the API, and it is behaving like this.

The HostElement was set to the wall, and the Curves were defined outward as shown in the left image. However, the actual result is displayed as shown in the right image.

0 Likes
Message 4 of 5

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Jusung-Kim ,

I would suggest creating the rebar manually in the Revit UI first, and then creating the same rebar through the API.

Next, select both rebars and inspect them using RevitLookup tool. Compare their properties, constraints, shape parameters, normals, host references, and layout data.


RevitLookup Tool: https://github.com/lookup-foundation/RevitLookup

This comparison usually reveals what differs between the manually created rebar and the API-generated one, which helps identify why the API result is not matching the expected behavior.


This is a common debugging approach followed by many experienced Revit API developers and is often the fastest way to understand unexpected rebar behavior.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

longt61
Advocate
Advocate

Hi @Jusung-Kim , could you share the result as an rvt file? That would be easier to analyze the cause of the issue.
By the way, you could also try to check for Rebar Constraints manually. Even though you created the correct segment lines for the rebar, in some cases where the newly created rebar is near some Rebar Constraint Candidates (they could be host faces, host rebar cover, other host faces and rebar cover, other rebar main segment plane or bend, etc..) the rebar will "snap" to those candidates. 
In my past experience, you can remove the candidate, but then Revit will automatically "re-evaluate" the constraint candidates and will create new "snapping" again. The best you could do is check all available candidates and set the most suitable one for your rebar.

0 Likes