MAXScript中可以通过System.Windows.Forms.OpenFileDialog来获取文件的全路径

--创建OpenFileDialog
theDialog=dotNetObject "System.Windows.Forms.OpenFileDialog"
--设置对话框的标题
theDialog.title="请选择文件"
--设置可以多选
theDialog.Multiselect = true
--过滤文件的类型
theDialog.Filter="Max文件(*.max)|*.max|所有文件(*.*)|*.*" 
--设置默认的文件过滤下拉列表是"所有文件"
theDialog.FilterIndex = 2 --显示对话框 将选中结果赋值给变量result result = theDialog.showDialog() --关闭对话框后 将result转换成字符串 result.ToString() --当按下OK 返回true result.Equals result.OK --当按下Cancel 返回true result.Equals result.Cancel --文件名最后以数组的方式返回 theFilenames = theDialog.fileNames

 

相关文章:

  • 2021-11-22
  • 2022-12-23
  • 2021-08-13
  • 2021-09-03
  • 2021-05-17
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
相关资源
相似解决方案