Guest User

groupFinishes

a guest
Aug 14th, 2020
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import clr
  2. clr.AddReference('ProtoGeometry')
  3. from Autodesk.DesignScript.Geometry import *
  4. #The inputs to this node will be stored as a list in the IN variables.
  5. from itertools import groupby
  6. dataEnteringNode = IN
  7.  
  8. rooms = IN[0]
  9. finishes=IN[1]
  10.  
  11. lst=[]
  12. outlist =[]
  13. for k in range(0, rooms.Count):
  14.     lst.append([[rooms[k]]] + [finishes[k]])   
  15.    
  16. for key, group in  groupby(sorted(lst, key=lambda x:x[1]), lambda x: x[1]):
  17.     outlist.append([key] + [i[0][0] for i in group])   
  18.  
  19. OUT = outlist
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×