Hi,
So sorry to ask what is likely a trivial issue, but I cannot find working modules.
I have Googled, Bard’d and searched Rhino Python examples
I need to iterate through folders, loading one by one many .3dm files and export them to .shp format.
Iterating through the os.walk() is not the problem.
What rhino 7 module do I use to do the equivalent of:
The most reliable way, that allows you to control everything, is to import PyShp, iterate over the Rhino files, pick a shape type, iterate over the objects in each Rhino file to be added to its shapefile, get a nested list of floats from each Rhino geometry object, and add those using shapefile.Writer (along with a null record if necessary, or call the fix all method when you’re done).
There are plug-ins for this in Grasshopper. There’s a shapefile Writer component in sDNA_GH (which uses my fork, IronPyShp, that unlike PyShp hopefully correctly supports unicode in the data part (.dbf) of the shapefile on IronPython). I think sDNA_GH only supports Polylinez shapefiles at the moment.
I believe Hiteka’s Ghshp works, but installation requires to copying the PyShp file to a special Rhino Iron Python directory.
There are others too, such as ShrimpGIS, Heron, @it and MeerkatGIS, if you can get them working. People do use ShrimpGIS. I noticed Heron tries to convert a Rhino Earth Anchor point into a .prj file (or a wkt text string) which might be useful if the Rhino file includes location info or uses geographical co-ordinates.