一直很想用用Max的 Script
其实Max的Script相比他本身的SDK还是有些优势的
首先是不用每次都重启Max调试
再有就是不用担心内存泄漏的危险,
最后Script的封装更加方便。
但是, 对于长期试用强类型编程语言的人来说 要适应脚本开发还是需要些时间的
脚本调试也不方便,缺乏强有力的异常处理手段 都是Script的弱点
第一次写MAx脚本,输出了一下Node:
1 macroScript AutoMat category:"HowTo2"
2 (
3 output_name = getSaveFileName caption:"SpeedSheet File" types:"SpeedSheet (*.ssh)|*.ssh|All Files (*.*)|*.*|"
4 if output_name != undefined then
5 (
6 output_file = createfile output_name
7 if output_file==undefined then
8 (
9 messageBox "can not open file"
10 --return
11 )
12
13 rnode=rootnode.name
14 format "The Root Node: %\n" rnode to:output_file
15
16
17 for o in rootnode.children do
18 (
19 format " Sub Node: % \n" o.name to:output_file
20 format " Base Class: % \n" o.baseobject to: output_file
21 format " \n" to: output_file
22 )
23
24 close output_file
25
26 edit output_name
27
28 )
29
30
2 (
3 output_name = getSaveFileName caption:"SpeedSheet File" types:"SpeedSheet (*.ssh)|*.ssh|All Files (*.*)|*.*|"
4 if output_name != undefined then
5 (
6 output_file = createfile output_name
7 if output_file==undefined then
8 (
9 messageBox "can not open file"
10 --return
11 )
12
13 rnode=rootnode.name
14 format "The Root Node: %\n" rnode to:output_file
15
16
17 for o in rootnode.children do
18 (
19 format " Sub Node: % \n" o.name to:output_file
20 format " Base Class: % \n" o.baseobject to: output_file
21 format " \n" to: output_file
22 )
23
24 close output_file
25
26 edit output_name
27
28 )
29
30
)