I want to set a parameter within a group, I succeded by ungrouping, doing the changes within the group and after grouping these elements again.
But I can not give the right name to the group and maybe is cause I am not using the Passthrough node from Clockworks correctly. Any Ideas? Fassade Numerierung.dyn (23.4 KB)
I sorted out the problem of empty lists by using a second Passthrough. Before ungrouping i needed to obtain the group members and then ungroup.
Although the problem is the same, the new groups dont take the name they should, i tried out with export in excel as Yna_Db propposed, but the problem is still there. I think the problem is that the Python skript of the node doesnt work out properly with my list structure. I think the node Group.FromElements is prepare to create only one group but not serveral groups with several names, at least that is my opinion after looking at the code… although I am not good at python…
As a second option that I am going to try is to do a second dyn. file and rename the groups with the excel list system from Yna_Db.
I am not totally sure the Excel workflow example would work as such to maintain identical group names, I noticed afterwards that the groups numbers were incremented. I did not have time yet to experiment further but I thought of using wether a BakeElements node from Rhythm or trying not only to delete groups by ungrouping them but also to delete associated group types. I will be interested in your results anyway…
doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
gNames = IN[1]
items = []
ids = []
rejects = list()
group = []
TransactionManager.Instance.EnsureInTransaction(doc)
for element,gName in zip(elements,gNames):
for ele in element:
try:
ids.append(ele.Id)
except:
rejects.append(element)
items = List[ElementId](ids)
try:
group = doc.Create.NewGroup(items);
group.GroupType.Name = gName
except:
group = list()
TransactionManager.Instance.TransactionTaskDone()
OUT = elements