Last active
December 17, 2015 13:29
-
-
Save yasushisakai/5617974 to your computer and use it in GitHub Desktop.
This script exports the current rhino file to 3ds format, separating it by layer. It was intended for exporting it to ArchiCAD which can be inserted as GDL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import rhinoscriptsyntax as rs | |
documentName = '.'.join(rs.DocumentName().split('.')[:-1]) | |
path = '\\'.join(rs.DocumentPath().split('\\')[:-1]) | |
print rs.LayerNames() | |
for layerName in rs.LayerNames(): | |
rs.UnselectAllObjects() | |
obj = rs.ObjectsByLayer(layerName) | |
if len(obj)==0:continue | |
rs.SelectObjects(obj) | |
#exportFilePath = '"'+path+'\\'+documentName+'_'+layerName+'.gsm'+'"' | |
exportFilePath = '"'+path+'\\'+documentName+'_'+layerName+'.3ds'+'"' | |
rs.Command('!_-Export '+exportFilePath+' _Enter') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment