From what I get you have a Wall Type with multiple layers and you
want to either replaced Type A by type B, or change the thickness
of one of the layers of one of the types.
What have you tried? Have you completed steps 1 and 2? You need to make some attempt in finding a node (or likely multiple nodes) to accomplish your request. Grouping the elements is likely a series of nodes that get values, determine relationships, and then organize data based on those results. There’s no node to just “do my thing”. You need to work through what that process should look like before we can suggest specific nodes to accomplish that task.
It sounds like you need to make your way through the Dynamo Primer and learn the basics before attempting something like this. Get familiar with managing list structures, filtering data, getting and setting parameter values, and general logical workflow steps. Reading through other threads dealing with these topics would also help, and maybe give you a better explanation of what sort of nodes to try or how to build out your logic.
I have different types of walls, with the only difference being their structural width. The width depends on the wall type, but I have only one parametric column base stud, which is placed inside the wall and can vary in size. When I run the script, the stud aligns with the wall, automatically adjusts to the width, and is placed correctly inside the wall. Only change the stud width as per the wall type.
As stated by the others, there isn’t a do everything node for this. But here is an overview on how you could approach it.
List each wall and find all studs that intersect with that wall. Since you have conditions where walls that intersect with each other and overlapping studs (as shown in the clip below) you will need to filter the studs by their orientation to the wall. Basically a stud that both intersects and is perpendicular to the walls facing direction. This will give you the wall and the group of corresponding studs. From that point you pull the width of the wall and write that value to the width of each stud in the corresponding stud group.
EDIT: One caveat to the above statement. If you have walls that are different in width and are parallel and they butt into each other as shown in the clip, the above method won’t work for the studs at the ends of each wall. I really don’t know of a good way to account for that condition, so maybe someone else can provide input.
Issue: you have one stud type and the width is set as a type parameter. So you can’t have varying widths unless you create different types per each width in the stud family. So you will need to account for that. Easiest option would be to have the width set to an instance parameter.
A human can look at the image and know which studs are associated with which walls (and their depth), but how does a computer know? How are you determining which studs need to be associated with which walls? That’s the next step in the logic that you need to work through. We don’t know what information you have in your model or in those specific elements to be able to suggest what you should do beyond geometry intersections and location analysis. But that’s how you get your groups of studs based on wall type.
Of course, I have created a group of wall widths, but I have a parametric stud family. I want the stud width to be derived from the wall type width rather than creating a separate group for it. When anyone runs the script, they will have only one stud type but may have multiple wall types.
That’s not what’s happening though. None of that deals with studs, so how does the wall width determine which studs are part of that wall? You need to get all stud instances and check to see which wall instances they intersect with. That will tell you the wall type and therefore the wall width.
Again, I’d suggest you search the forum for similar topics that deal with location of elements. You won’t be able to search for your specific case, but there are plenty of discussions on workflows that deal with locating elements in walls or rooms or other “hosts”. You need to do the same kind of analysis to determine your “grouping”.