-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetObjData.py
More file actions
42 lines (28 loc) · 715 Bytes
/
Copy pathsetObjData.py
File metadata and controls
42 lines (28 loc) · 715 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
39
40
41
42
import rhinoscriptsyntax as rs
import trkRhinoPy as trp
objs = rs.GetObjects('select objects', preselect=True)
rs.EnableRedraw(False)
keys = 'usage func type'
def Func(x):
trp.valuesFromLayer(x)
trp.setValueByLayer(x,keys)
trp.setObjAreaValue(x)
trp.setBrepHeight(x)
def setClass(obj):
classKeys = 'units public'
try:
func = rs.GetUserText(obj, "func")
if func in classKeys:
classValue = func
else:
classValue = "na"
rs.SetUserText(obj, "class", classValue)
except:
return
def applyFunc(objs):
map(Func, objs)
map(setClass, objs)
if objs:
applyFunc(objs)
'''class data'''
rs.EnableRedraw(True)