Creating the Circle Cutout

Next you need to create the cutout or circle. Because the circle command is a completely new command we start it with the apostrophe ! symbol.
! Circle

You have a choice of creating the circle in it's proper location or anywhere in 3d space for that matter. I almost always create objects at the world 0,0,0 origin and then move the object to it's correct location. The reason is the two parameters that of the object's size and location can be controlled in your script easily without one effecting the other. Even though Rhino lets you create the circle or objects and their location at the same time, it really is a good idea to separate the two activities. Then you can change and objects size in a script without having to worry about if that change altered the placement coordinates. As you continue with the tutorials you will see how this gives you more control over placing, rotating and scaling of objects in a script.

To continue the circle command you enter the 0,0,0 origin the same as you did for the rectangle so you can use the 0 shortcut instead. You are also faced with a command line choice that of creating the circle based on its' diameter or it's radius. You will choose the diameter or D option in this case. This is a small quirk. If you already created a circle and you used the d option diameter at the command line, after running this script you will see a dimension not known statement in the command history after the d parameter line. This is not a mistake. What is happening is that Rhino internally stores your parameter switches for certain commands like a circle's radius or diameter during a Rhino modeling session so that you don't have to type that switch again. When you reuse the command you don't need to tell rhino to use the d diameter switch again. The command history is noting that Rhino doesn't need to know this command switch because it remembers that you are using the diameter switch already. However imagine that I used or you used the radius switch and then ran the script. The circle, which now has a 1.5 radius, would have a 3-unit radius. You need to be careful with these switches and make your script succinct in case you change parameters or you want to share your script with someone else. What you are in essence doing is you are totally telling Rhino what to do and not leave it up to chance.

Adding in the extra parameter switch and then the actual diameter measurement the script should now read:

! rectangle
! Circle

Test the command script thus far by highlighting and copying the text from Notepad, activate top view and click the commandpaste icon. See image below. Select all and delete.