Creating a Parameter Group

  1. Create a Script group.
  2. Right-click in the Groups Panel and choose Create Parameter from the menu.

    The parameter is created with a default name and a default value of zero.

  3. Rename the Parameter.

Script Group and Parameter Example

This example shows how Parameter Groups can be used to modify the parameters of the Gear script.

  1. Insert the Gear snippet into an empty script.
  2. Save the script to a Script Group.
  3. Create a Parameter group as described above and name it "Teeth".
  4. Look for the variable "nTeeth" in the script and edit it as shown below.
  5. Click the 'Teeth' Parameter in the Groups Panel and change it to the original value of 20.
  6. Right-click the Script Group and choose Run Script from the menu to create a 20-tooth gear.
  7. Expand the Script Group node in the Groups Panel and see that it displays the current value of the Teeth parameter.
  8. By default, scripts run after you change a parameter value. Right-click the Script Group and choose Pause from the menu keep the script from running until you explicitly run it. The script icon in the Groups Panel now has a 'paused' icon.
  9. Change the Teeth parameter to 40 and see that the script group now has a yellow triangle in the Groups Panel to indicate that the Teeth parameter has changed.
  10. The snippet does not delete the current gear before it creates a new one. So, delete the current gear and rerun the script to create a 40-tooth gear.
  11. Right-click in the Groups Panel and create a new Parameter named "oRadius".
  12. Find the 'oRadius' variable in the script and edit as you did for the Teeth parameter.
  13. Change the parameter value to 0.02 to match the initial value in the script.
  14. Right-click the parameter and change the units to Length.
  15. Notice that the Parameter value changes to "20mm", indicating that the script assumes length units of Meters.
  16. Change the value to 30mm and change the number of teeth back to 20
  17. Delete the current gear
  18. Run the script to create a gear with 20 teeth and an outside radius of 30mm.