[AppleScript] 纯文本查看 复制代码 #coding=utf-8
import rhinoscriptsyntax as rs
import scriptcontext as sc
import os
def SaveDXFByObjName():
folder=rs.WorkingFolder()
doc_path=rs.DocumentPath()
ft="DXF"
msg="Main file name/folder for {} export?".format(ft)
if doc_path:
msg+=" (Enter to save in current folder)".format(ft)
folder=doc_path
save_folder = rs.BrowseForFolder(folder,msg)
name = rs.GetString("保存文件的名字")
filename=os.path.join(save_folder,(name+".DXF"))
rs.Command('-_save "{}" _Enter'.format(filename), True)
rs.EnableRedraw(True)
SaveDXFByObjName()
也可以试试这一段rhinopython代码,可以自己做一个按钮或者设置一个快捷键。
代码运行:先选择一个存储的路径文件夹,输入存储文件的名字就OK了
|