How i can collect single rebars to one set (grouping)

Can anyone help me how i can How i can collect single rebars to one set (grouping) by dynamo
I try more but can’t do it

Please help
And thanks

What defines a set or grouping? Where does that data live? How have you tried accessing it? Do you need to filter any of it?

Grouping is pretty straight forward using List.GroupByKey. You just need to have the information you want to group by.


All this individual rebars same diameter
Same length
Same shape
Same everything

I need make all these rebars one set
Like layout rule maximum spacing

You can group by multiple values, but for something like this it’s probably easier to use the “combined string method”.

  1. Get the parameter values that you need from each rebar instance.
  2. Combine the values into a single string (per rebar) to give you a rebar “code”.
    e.g. "Val1-Val2-Val3-Val4..."
  3. Use GroupByKey to group the rebar elements by their combined values (the combined “code” from above).


??

What are you attempting to do here? You’re checking if a value is equal to itself and then grouping by that condition, which will always be true. You need to look at all the values you want to group by and match which rebar have all the same property values.

All these rebars have same every instancr parameters

All these rebars same every instance parameters

So you’re not wanting to group your rebar by value. You have existing rebar that you want to convert to a rebar set? How would you do that natively through the Revit UI? From my understanding, a rebar set is defined by a single piece of rebar. You wouldn’t create multiple instances and then “join” into a set.

I do these rebars by dynamo and can only do that individual rebars because its curve distribution can’t do it set

Then i need make them one set

This link video for what i mean

Dynamo can only automate what’s allowed in Revit. If you can’t have a curved set in Revit then Dynamo won’t be able to fix that. I still don’t see a native way to create a new set from a selection of rebar. The video you shared is using an add-in for the grouping and ungrouping. How would you do this “manually”? If you can explain the process through Revit functionality then we might be able to find the associated commands in the API.

he made it by script dynamo and then add that script to addins to sold it

i make these rebars by diroots package it duplicates shape by using curve i selected

and then all rebars be individual rebar not set
bcs cant make curve vector of course

Right. It seems like you could automate grouping and ungrouping by creating new brand new sets that mimic the existing rebar. But if your issue is that you have a curved path and curved paths aren’t allowed for rebar sets then you can’t change that.

Is there any way in Revit to have a curved distribution in a rebar set?

By rebar free form

You’ll have to look at the API methods for free form rebar and see if they can do what you want. I still think you’d create the set from scratch, not from existing rebar though.
CreateFreeForm Method