Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Last active June 13, 2020 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/4568267dbdf82485bb3b3449f2a8f699 to your computer and use it in GitHub Desktop.
Save chuongmep/4568267dbdf82485bb3b3449f2a8f699 to your computer and use it in GitHub Desktop.
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
arr = IN[0]
posArr = list(filter(lambda a: ("Room" in a), arr))
def splitFn(a):
return a.split("=")[1]
def joinPoints(p):
return ','.join(p)
def splitPoints(c):
return c.split()
coords = list( map(splitFn, posArr) )
pointsArr = []
print(coords)
for s in coords:
splittedArr = splitPoints(s)
pointsArr.append(joinPoints(splittedArr))
OUT = ["["+x+"]" for x in pointsArr]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment