-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsonsToRhino.py
More file actions
executable file
·38 lines (29 loc) · 1012 Bytes
/
jsonsToRhino.py
File metadata and controls
executable file
·38 lines (29 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sys
if 'rhinopythonscripts' in sys.modules:
del sys.modules['rhinopythonscripts']
## this is an IronPython script
import Rhino
import scriptcontext
import rhinopythonscripts
from rhinopythonscripts.FileUtils import deleteAll, exportFile
from rhinopythonscripts.RunCPythonScript import run as runC
from rhinopythonscripts.GeoJson2Rhino import load as jsonLoad
cModule = 'C:\\Users\\demonchaux\\Dropbox\\localcode\\loadAmigosData.py'
def createJsonFiles(idList):
froot = 'C:\\amigos\\dump\\%s-site.3dm'
for id in idList:
deleteAll()
print "loading site %s" % id
out, err, code = runC(cModule, [id])
if code == 1: # there's an error
print err
else:
print 'building geometry'
guids = jsonLoad(out)
fpath = froot % id
exportFile(fpath)
print "Successfully wrote %s" % fpath
print 'done'
if __name__=='__main__':
idList = range(767)
createJsonFiles(idList)