This file contains hidden or 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 os | |
import scriptcontext | |
import rhinoscriptsyntax as rs | |
print "//export run started/////////////" | |
# this function via mcneel/rhinoscriptsyntax | |
#https://github.com/mcneel/rhinoscriptsyntax/blob/master/Scripts/rhinoscript/layer.py | |
def layerNames(sort=False): |
This file contains hidden or 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
establishCurve = function(curveArray,sumTotal,inverse){ | |
if(inverse){ | |
var maxVal = Math.max.apply(Math, curveArray); | |
var minVal = Math.min.apply(Math, curveArray); | |
curveArray = curveArray.map(function (x) { | |
return (maxVal-x)+minVal; | |
}); | |
} | |
var curveTotal = curveArray.reduce(function(a, b) { | |
return a + b; |
This file contains hidden or 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
on searchReplace(theText, SearchString, ReplaceString) | |
set OldDelims to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to SearchString | |
set newText to text items of theText | |
set AppleScript's text item delimiters to ReplaceString | |
set newText to newText as text | |
set AppleScript's text item delimiters to OldDelims | |
return newText | |
end searchReplace |