Page 1241 - Kitab3DsMax
P. 1241
8. With the layout complete, choose File ➪ Save (or press Ctrl+S) to save the layout, and then close
the Visual MAXScript window.
The script code associated with the layout is automatically placed in the editor window.
9. Complete the script by entering the script commands immediately after the open parenthesis that
appears on the line following the on createCube pressed do event, as shown in Figure 49.21.
Then, copy and paste the code from the BuildCube.ms file from the Chap 49 directory on the DVD.
FIGURE 49.21 Chapter 49: Automating with MAXScript
The MAXScript Editor window is updated with the code from the Visual MAXScript window.
10. Open the Utilities panel, and click the MAXScript button. Then click the Run Script button, and
select the BuildCube.ms file from the Chap 49 directory on the DVD.
The utility installs and appears in the Utility drop-down list in the MAXScript rollout.
11. Select the BuildCube utility from the drop-down list in the MAXScript rollout, and scroll down
the Command Panel to see the Build Cube rollout. Select the sphere object, and click the Create
Cube button.
The script executes, and a cube of spheres is created.
Figure 49.22 shows the results of the BuildCube.ms script. You can use this script with any selected object.
1193