Last active
June 13, 2020 15:56
-
-
Save chuongmep/4568267dbdf82485bb3b3449f2a8f699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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