예제 #1
0
def getSourceKeys(source, bakename=False):
    if rs.IsUserText(source) == 0:
        print 'no keys'
        return
    if bakename == False:
        return [x for x in rs.GetUserText(source) if "BakeName" not in x]
    else:
        return [x for x in rs.GetUserText(source)]
예제 #2
0
def getWindowUserText(_in):
    with idf2ph_rhDoc():
        windowDataFromRhino = {}

        if rs.IsUserText(_in):
            print 'Pulling data from Rhino model for Window: {}'.format(
                rs.ObjectName(_in))
            # Get the User-Text data from the Rhino Scene
            for eachKey in rs.GetUserText(_in):
                windowDataFromRhino[eachKey] = rs.GetUserText(_in, eachKey)
            return windowDataFromRhino
        else:
            return None
예제 #3
0
파일: initialTB.py 프로젝트: TfedUD/Gh-2-eQ
def getAttrs(_in, _key):
    results = []
    for each in _in:
        if _key == 'Object Name':
            results.append(rs.ObjectName(each))

        else:

            if rs.IsUserText(each):
                for eachKey in rs.GetUserText(each):
                    if _key in eachKey:
                        results.append(rs.GetUserText(each, _key))
                        break

    if len(set(results)) > 1:
        return '<varies>'
예제 #4
0
def getAttrs(_in, _key, _defaultVal):
    # Takes in a list of Objects (_in) and the key to search for in
    # User-Text. Returns '<varies>' if more than one value is found for the key
    results = []
    for each in _in:
        if _key == 'Object Name':
            results.append(rs.ObjectName(each))
            # Get the objects Name
        else:
            # Get the User text info
            if rs.IsUserText(each):
                for eachKey in rs.GetUserText(each):
                    if _key in eachKey:
                        results.append(rs.GetUserText(each, _key))
                        break

    if len(set(results)) > 1:
        return '<varies>'
    else:
        try:
            return results[0]
        except:
            return _defaultVal
예제 #5
0
def copySourceData(obj, source):
    if rs.IsUserText(source) == 0:
        return
    keyValue = sourceKeyValue(source)
    # print keyValue
    map(lambda x, y: rs.SetUserText(obj, x, y), keyValue[0], keyValue[1])
예제 #6
0
def getSourceKeys(source):
    if rs.IsUserText(source) == 0:
        print 'no keys'
        return
    return [ x for x in rs.GetUserText(source) if "BakeName" not in x ]