Rebar Creation with rebar shape

Rebar Creation with rebar shape

pyaezone
Explorer Explorer
290 Views
1 Reply
Message 1 of 2

Rebar Creation with rebar shape

pyaezone
Explorer
Explorer

Hi,

I want to get al l the RebarShape Types in the project and use one of them to create rebar using Rebar.CreateFromRebarShape.

I could get all rebar shape as elements using filteredElementCollector with BuiltInCategory.OST_RebarShape.
However, I cannot cast this element into RebarShape and as a result it is always null and cannot create using CreateFromRebarShape.

Is there any way I can achieve that?

Thanks

0 Likes
291 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

As a first step, I would suggest searching the Revit SDK samples for CreateFromRebarShape. I see it in the NewRebar and MultiplanarRebar samples. You should always perform two steps whenever you encounter a question like this:

  

  

  

 

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes