Access rebar element through rebar container

Access rebar element through rebar container

Anonymous
Not applicable
1,783 Views
6 Replies
Message 1 of 7

Access rebar element through rebar container

Anonymous
Not applicable

Hi! 

 

I am trying to create a rebar schedule in Dynamo but it seems to be not so easy to me... 😞

 

Can I get a help on accessing rebar elements from rebar containers?

 

 

Followings are what I have tried in Python...

 

bars = FilteredElementCollector(doc).OfClass(Autodesk.Revit.DB.Structure.RebarContainer).ToElements()

(I can get rebar container list from this line)

 

bars = FilteredElementCollector(doc).OfClass(Autodesk.Revit.DB.Structure.Rebar).ToElements()

(but this line returns nothing)

 

I have also tried this one... but I couldn't understand what exactly the RebarContainerItem means..

foreach(RebarContainerItem item in con.GetRebarContainerIterator())
{

}

 

Any help would be appreciated!!

Thanks

 

 

0 Likes
Accepted solutions (1)
1,784 Views
6 Replies
Replies (6)
Message 2 of 7

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear JLee,

 

Just looking at the Revit API help file Revit API.chm, I see the following description of the RebarContainer class: "The Rebar Container element ... is a collection of rebar sets".

 

Therefore, how could you expect to be able to access an individual rebar in a RebarContainer element?

 

The RebarContainerItem objects contained within the RebarContainer provide a list of member properties and methods that you should take a closer look at.

 

They may provide what you need.

 

Have you installed the Revit SDK and taken a look at the Revit API help file Revit API.chm?

 

I think you will need to do that in order to understand more.

 

Good luck, much success exploring, and have fun!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 7

Anonymous
Not applicable
Thanks Jeremy. I am downloading sdk file now and will take a look at Revit API help file.
0 Likes
Message 4 of 7

Anonymous
Not applicable
0 Likes
Message 5 of 7

anton.bondarchuk
Explorer
Explorer

guys, I'm having the exact same issue.. Does anyone have ideas on how to schedule bars/ tag these in views that belong to a RebarContainer?? I've started exploring RebarContainer class via API & see very limited use for it.. When bars 'assembled' into RebarContainer they lose Rebar Numbers (even though Partition as a readonly property extended to the whole RebarContainer object). RebarContainerItem objects do not have any properties that can be used for scheduling (apart from ItemIndex maybe, but it cannot be reported to Revit schedules..).. Is there a solution to scheduling and tagging in views individual RebarContainerItems??

0 Likes
Message 6 of 7

jeremy_tammik
Alumni
Alumni

I asked the development team for you and will let you know when I hear back from them.

  

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

anton.bondarchuk
Explorer
Explorer

Hi Jeremy,
Thank you for your comment. I would highly appreciate any advice on how to achieve the above. I'm looking into ExtensibleStorage now to configure schema data suitable for my scheduling purposes, but it seems overly complicated for this particular task. RebarContainer class is a really good idea, but unfortunately it's usability is rather very limited

0 Likes