# Open and close a 3dm file with python on mac

**URL:** <https://discourse.mcneel.com/t/open-and-close-a-3dm-file-with-python-on-mac/11569>\
**Category:** Scripting\
**Created:** [September 10, 2014, 5:23pm UTC](https://discourse.mcneel.com/t/open-and-close-a-3dm-file-with-python-on-mac/11569 "2014-09-10T17:23:08Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Alain](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alain/32/512812_2.png) [@Alain](https://discourse.mcneel.com/u/Alain)\
**Post date:** [September 11, 2014, 6:28am UTC](https://discourse.mcneel.com/t/open-and-close-a-3dm-file-with-python-on-mac/11569/3 "2014-09-11T06:28:13Z")

</div>

Hi @dale,

Of course.

@matteo_ledri is this what you need?

```auto
import rhinoscriptsyntax as rs
import System

# hard coded list of files
files = ['C:\\Users\\rhino\\Documents\\__file1.3dm',
    'C:\\Users\\rhino\\Documents\\__file2.3dm',
    'C:\\Users\\rhino\\Documents\\__file3.3dm']

# or all files in a common root directory
files = System.IO.Directory.GetFiles(
    'C:\\Users\\rhino\\Documents\\filestoedit', 
    '*.3dm', 
    System.IO.SearchOption.AllDirectories)

for file in files:
    rs.Command('_-Open ' + file)
    rs.AddBox([(-5,-5,-5), (5,-5,-5), (5,5,-5), (-5,5,-5), (-5,-5,5), (5,-5,5), (5,5,5), (-5,5,5)])
    print "file:{0}".format(file)
    rs.Command('_-Save _Enter')

rs.Command('_-New None')

```

---

_[View the full topic](https://discourse.mcneel.com/t/open-and-close-a-3dm-file-with-python-on-mac/11569)._
