<div>
<div>for room in roomsAll:</div>
<div> area = room.LookupParameter(“S_Стены_py”).AsDouble()</div>
<div> lookup1 = room.LookupParameter(“Потолок_Монтаж_Иван”).AsString()</div>
<div> lookup2 = room.LookupParameter(“Стены_Монтаж_Иван”).AsString()</div>
<div> lookup3 = room.LookupParameter(“Плинтус_Монтаж_Иван”).AsString()</div>
<div></div>
<div> areaMarble = area / 10</div>
<div> sortMarble = [(areaMarble, lookup1, lookup2, lookup3)] #()-range</div>
<div> for key, group in groupby(sorted(sortMarble, key = lambda x: (x[1], x[2], x[3])), lambda x: (x[1], x[2], x[3])):</div>
<div> groupMarble = 0</div>
<div> for group1 in group:</div>
<div> groupMarble += group1[0]</div>
<div> areaDecor = area – (area / 10)</div>
<div> sortDecor = [(areaDecor, lookup1, lookup2, lookup3)]</div>
<div> for key, group in groupby(sorted(sortDecor, key = lambda x: (x[1], x[2], x[3])), lambda x: (x[1], x[2], x[3])):</div>
<div> groupDecor = 0</div>
<div> for group1 in group:</div>
<div> groupDecor += group1[0]</div>
<div></div>
<div> #”\033[33m{}”.format(‘a’)</div>
<div> uniteArea = ‘.’ + ‘\n’ * 3 + str(round(groupMarble * 0.3048**2, 2)) + ‘\n’ * 3 + ‘______’ + ‘\n’ * 9 + str(round(groupDecor * 0.3048**2, 2))</div>
<div> param_1 = room.LookupParameter(“python_отделка_groupby”)</div>
<div> param_2 = room.LookupParameter(“S_отделки_Groupby”)</div>
<div> python_decor = room.LookupParameter(“python_отделка”).AsString()</div>
<div> if python_decor == “Мраморные плиты и Декоративная штукатурка”:</div>
<div> param_1.Set(text)</div>
<div> param_2.Set(uniteArea)</div>
<div> if python_decor == “Обои декор. и мраморные плиты”:</div>
<div> param_1.Set(text2)</div>
<div> param_2.Set(uniteArea)</div>
<div>TransactionManager.Instance.TransactionTaskDone()</div>
<div>OUT = group1</div>
</div>