【发布时间】:2015-11-10 13:29:06
【问题描述】:
我正在尝试从 maxscript 中选择的材料中收集一些数据并将它们保存到 xml 文件中。起初我尝试使用 txt 文件,但我似乎被卡住了。
这是我所拥有的:
try(DestroyDialog Test)catch()
Rollout Test "TestMt" width: 200 height: 120
(
button btn_name "Connection" height: 50 width:80
button btn_export "Export Mt Data" height:50 width:90
fn Createtxt =
for o in selection do
(
out_name = ((GetDir #export)+"/testmesh3.txt")
out_file = createfile out_name
)
on btn_export pressed do
(
Createtxt()
)
)
Createdialog Test
【问题讨论】:
-
到底有什么问题?你能说得更具体点吗?
-
我在运行脚本时遇到 I/O 错误,在保存文件时遇到或未命中。我可以运行一次并保存,但我再次运行它并失败。
-
很有趣.......我在一个干净的最大场景中尝试它并且它工作正常,(在工作中尝试它可能是它的管道)所以我现在的问题是,这是正确的行写入文件? for o in selection do ( out_name = ((GetDir #export) ="/testmesh.txt) out_file = createFile out_name format "%,%\n" o.name o.material to:out_file ) 感谢您的帮助!跨度>