Last active
June 14, 2020 09:06
-
-
Save chuongmep/4b1b6b2fa5e7db0fbc02092fb87d774b 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 * | |
dataEnteringNode = IN | |
arr = IN[0] | |
posArr = list(filter(lambda a: ("Pos" 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)) | |
print(pointsArr) | |
OUT = pointsArr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment