Saturday, May 15, 2010

Pro/Program

Pro/PROGRAM is a simple programming interface that may be used to create interactive parts. Pro/PROGRAM requires very little programming knowledge (you do have to understand IF statements). It is a simple, dynamic tool for creating variations of a design through a definable user interface.

Pro/PROGRAM can be used to create different configurations of any design that has standard variables that govern the modifications. Whenever you create a part, data is stored in its database that describes how features are created. This data may be edited in a text file by choosing the Program option from the Tools menu. For example:

You can edit this program to add logic that will add or not add features based on IF statement evaluations. You can also add mathematical computations, interactive prompts to get information from the user, etc. Whenever the part or assembly that defines the program regenerates, the program is automatically run.

For example, an elevator button panel has a standard set of variables that govern the different variation of the design: number of floors, two or three columns, whether or not there is a level below the lobby, etc.

Version 1 Version 2

Figure 1

You could create a Pro/PROGRAM of a completed panel assembly that prompts the user for these key variables and either modifies dimensions to correct sizes or swaps models in and out of the final assembly depending upon the configuration.

Pro/PROGRAM is like a dynamic family table, where a simple BASIC-like program prompts the user for inputs, then drives the design. The inputs can be numbers, strings, or yes/no parameters, and can drive dimensions directly (What is the length of the box?) or alter geometry through if-then-else loops (Do you want the hole?). The model is displayed as its information structure, with each feature in a block of text. If a loop is placed around the text, this feature can be turned on or off depending upon the requirements.

There are several items of note in this example. The input variables can be yes_no, numbers, or strings. The prompt for the input can be user defined if placed directly below the input line. The inputs can be varied through if-then statements. The variables can be passed to dimensions through relations or to geometry through if-then statements. The user will be requested to run the program every time they regenerate.

Note: If the dimension parameter symbol is set to the same name as the input variable name, no relation is required.

1 comment:

  1. Dear Kailas,

    This is a very helpful post, especially for the “INPUT” syntax. I am currently working on a similar design, where different features are being created, depending on the values declared in Relations. Are you familiar with any techniques to create drawings with dimensions connected to the current part instance? (In your example, how to make the drawing of the part, with the hole dimensioning when "hole==yes", and without it, when "hole==no"). I will appreciate any hints you could provide! Thanks!
    With best regards,
    -bejgee

    ReplyDelete