Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Open all files of type in subdirectories

$
0
0

Hi all,

I feel like this is close but falling down at import. I had a look at other answers for similar questions couldn’t quite get it.

path = str('lots of folders up to\\03 Design Supplied')
dwg = 'dwg'

def finddwgsinpath(path):
    for path, subdirs, files in os.walk(path):
        for name in files:
            if dwg in name:
                dwgpath = os.path.join(path, name)
                rs.Command("_-Import "+ dwgpath + " Enter",False)
                rs.Command("_Pause")
                print('imported...', dwgpath)
finddwgsinpath(path)

Thanks!

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles