Pro Program
Pro Program
Pro Program
web hosting
domain names
photo sharing
Contents Book Index Books Products Master Index Search Print Customer Service About Help Home
Pro/PROGRAM
With Pro/PROGRAM you can create a program that controls the design of parts or assemblies by editing parametric designs for models. Using Pro/PROGRAM, you can design models with similar characteristics to meet specific design criteria. Pro/PROGRAM is available with the license for Pro/ASSEMBLY. Topic Entering the Pro/PROGRAM Environment Using Pro/PROGRAM Design From Model and Design From File Viewing a Design Editing a Design Editor Errors Incorporating Changes in the Model Creating Instances An Example of a Parametric Design
Using Pro/PROGRAM
Each model in Pro/ENGINEER has a listing of major design steps and parameters. This model design listing can be edited to work as a program. By running the program, you change the model according to new design specifications. To gain access to a listing for browsing, use the Show Design command on the PROGRAM menu. For more information, see Viewing a Design. To gain access to a listing for editing, use the Edit Design command on the PROGRAM menu. For more information, see Editing a Design.
For information on how to update your model according to the latest instructions, see Incorporating Changes in the Model.
From Model--Retrieve a design listing built in the model. From File--Retrieve a design for a model from an existing file named assemblyname.als or partname.pls.
Note: From Modelreflects the current state of the model, while From Fileincludes all new instructions that you have added during the last editing session.
Viewing a Design
You can use the Show Design or Edit Design command from the PROGRAM menu to view the model design.
q
If you choose Show Design, the program appears in an Information Window. If you choose Edit Design, the program appears under the system editor--usually in the start-up window.
Notice that in the header of every design listing, a REVNIM indicates the last model revision. The system uses this to detect if the design is outdated. A typical design listing may contain any of the following:
q
Input variables with their current values Relations IF-ELSE clauses Lists of all the features, parts, or assemblies in the design which, when enclosed within ``IF condition... ELSE... END IF'' statements, create alternate design branches EXECUTE statements (Assembly mode only)
Editing a Design
By editing a design, you make changes to a model. This section presents the types of design edits you can perform. Although the editor permits you to make other changes (changes not discussed in the following section) in the design, it ignores these changes upon execution. Only those discussed below are actually changed in the design. For example, if a feature attribute was changed from THRU ALL to THRU NEXT, the attribute that appears in the model after execution is THRU ALL. To edit a design, choose Edit Design from the PROGRAM menu. If two designs exist for the model, you must choose From Model or From File from the WHICH DESIGN menu. Note: When you edit your design for the first time, or after you have successfully incorporated changes in the model, the WHICH DESIGN menu does not appear. In these cases, the design is edited only ``from model.''
http://silverstone.fortunecity.com/daytona/344/proehelp/fundamentals/program.htm (3 of 27)5/15/2006 5:50:06 PM
Note that a warning appears when you attempt to edit From Model while a file with a Pro/PROGRAM listing exists in the working directory. This warning reminds you that when you exit from the editor the file will be overwritten with the new contents. If you still want to proceed with editing (this replaces an old design file), enter Y. To abort editing, enter N. If you are working with an assembly that has components belonging to a family table, listings for instances may be viewed, but cannot be edited, because the program always resides in the generic part. Note: In order to gain access to the listing in a generic assembly, assembly instances should be cleared from workstation memory.
Number--Enter a number for this variable type. String--Enter a string of characters for this variable type. This enables you to enter parameters or model names, but not user attributes. YES_NO --Enter either Y or N for this variable type.
Note: If no type is specified for the variable, the system default is Number.
Including Prompts
Whenever input is required, the system prompts you to enter the value of the input variable. Instead of using the system prompts, you can customize prompts for particular input variables. Then, during design execution, the prompts appear when the associated variable requires input. The rules for including prompts are as follows:
A prompt must be enclosed in quotation marks. A prompt must immediately follow the corresponding input variable.
For example: INPUT THICKNESS NUMBER ``Enter wall thickness for the cylinder'' INCLUDE_VALVE YES_NO ``Is valve to be included for analysis'' STOCK_ID STRING ``Enter the part's stock ID'' ... END INPUT
Relations
All relations valid in a Pro/ENGINEER model can be entered in a Pro/PROGRAM design. The operators, functions,
http://silverstone.fortunecity.com/daytona/344/proehelp/fundamentals/program.htm (5 of 27)5/15/2006 5:50:06 PM
and syntax of relations are described in Relations. If an expression you want to include in the RELATIONS statement contains more than 80 characters, use a backslash (\) to interrupt the current line and continue the expression on the next line. The format can be the following: RELATIONS PARAMETER = COVER_SIZE/2 + LENGTH*0.75 -\ 0.75*d3*d3 + THICKNESS*2 END RELATIONS Changing the material density in a part causes the system to update the mp_density value in relations and vice versa. Notes:
r
When using negative dimensions, a dollar sign ($) should precede the dim symbol in both the input statement and the external input files. For example, use $d20 instead of d20. The dimensions will not be updated if a dollar sign does not precede the symbols. If the program assigns a value to a dimension variable that is already driven by a part or subassembly relation, two error messages appear. Edit or remove the program relation and regenerate.
IF - ELSE Statements
Design Branches
Conditional statements can be used to create a design branch, enabling you to control whether a feature or component is included in the design. For example, if the original Part design was: ADD PROTRUSION..... ADD HOLE..... ADD CUT..... the modified design might look like: ADD PROTRUSION..... IF d1 > d2 ADD HOLE ... END ADD ENDIF ADD CUT..... END ADD
Conditional statements are also valid for assemblies. They control whether a particular part or subassembly is added to the assembly or executed. For more information, see EXECUTE Statements. In the following example, PART_B is not used unless the parameter DIA has a value less than or equal to 1.25. ADD PART .... IF DIA > ADD PART ..... END ADD ELSE ADD PART ..... END ADD ENDIF BASE_1 1.25 PART_A
PART_B
Pro/ENGINEER reevaluates any Pro/PROGRAM feature conditional statements (for example, IF... statements) before regenerating each feature. As a result, only a single Regenerate command is needed for a design in which Pro/ PROGRAM feature conditional statements are changed by Evaluate features and reference dimensions. However, if you add to a design a Pro/PROGRAM feature conditional statement that is changed by a later feature, the system prints an error message that the design is now inconsistent.
COMPONENT statement or relation must include the component ID. The format for assembly relations is: XYZ = <parameter_name>:fid_<feature_name>:<comp_id> or XYZ = <parameter_name>:fid_<N>:<comp_id> where <comp_id> is the component ID in the assembly of the referenced part. To determine the component ID (<comp_id>) in Assembly mode, choose Component Id from the RELATIONS menu and use Query Select to select the proper component. For more information, see Relations.
Using Relations
How to Interchange Components Using Relations 1. In the INPUT statement, include a YES_NO variable: For example: INCL_CRANK YES_NO 2. Add an IF_ELSE clause in the RELATIONS. For example: RELATIONS IF (INCL_CRANK == YES) PART_NAME = ``CRANK'' ELSE PART_NAME = ``SHAFT'' ENDIF END RELATIONS The ADD statement includes the variable defined in the ADD statement (it is enclosed in brackets). For example: ADD PART (PART_NAME) ... END ADD
where
q
generic name--Name of the generic model with a .prt or .asm extension match_mode--One of the following values:
r
-1 (find closest instance with param values less than or equal to supplied values) 0 (find instance with param values that match supplied values exactly) 1 (find closest instance with param values greater than or equal to supplied values)
Example: Given an assembly that consists of a block and a peg, assemble the instance that matches the diameter of the hole in the block. inst_name = declared string parameter initialized to generic part name generic_name = peg.prt. This part contains a number of instances based on diameter dimension (d) and length dimension (d1). Family instance names of peg.prt include: 2 2 2 3 3 3 x x x x x x 4 5 6 4 5 6 - d0 = 2, d1 - d0 = 2, d1 - d0 = 2, d1 - d0 = 3, d1 ............ ............ = = = = 4 5 6 4
Add a relation to the control in which peg.prt is added to an assembly controlled by dimensions of a feature in block. prt. The relation is: inst_name = lookup_inst (``peg.prt'', 0 , ``d2'', d6:0, ``d1'', d5:0 +1) In this way, the instance of peg.prt being assembled to blockpeg.asm is controlled, based on the dimensions of the hole in block.prt. The Pro/PROGRAM listing would look like this: INPUT END INPUT
http://silverstone.fortunecity.com/daytona/344/proehelp/fundamentals/program.htm (10 of 27)5/15/2006 5:50:06 PM
RELATIONS INST_NAME = LOOKUP_INST (``PEG.PRT'', 0, ``D2'', D6:0, ``D1'', D5:0 + 1) END RELATIONS ADD PART BLOCK INTERNAL COMPONENT ID 1 END ADD ADD PART (INST_NAME) INTERNAL COMPONENT ID 2 PARENTS = 1 (#1) END ADD MASSPROP END MASSPROP
To use a CHOOSE statement, you must first manually replace a family table instance of the group or replace the group with another group. For more information, see Replacing a Groupin Copying Features in the Part Modeling User's Guide. CHOOSE statements cannot be included in conditional statements.
The group leader's ADD statement could look like this: ADD FEATURE (initial number 4) INTERNAL FEATURE ID 300 PARENTS = 33(#1) TYPE = PROTRUSION FORM = EXTRUDED SECTION NAME = S2D0002
http://silverstone.fortunecity.com/daytona/344/proehelp/fundamentals/program.htm (11 of 27)5/15/2006 5:50:06 PM
DEPTH = FROM SKETCH TO BLIND FEATURE'S DIMENSIONS: d44 (d23) = 2.00 d45 (d24) = 1.00 d46 (d25) = 1.00 d47 (d26) = 2.00 d48 (d27) = 1.00 MEMBER OF A GROUP, NAME = RECT LEADING FEATURE OF THE GROUP: ID = 303 LAST FEATURE OF THE GROUP: ID = 303 GROUP IS REPLACEABLE BY FEATURES ID (NAME): 409(round) and 352 (circular) END ADD
EXECUTE Statements
EXECUTE statements are valid for assembly listings only. They provide a link between input variables in an assembly and input variables for programs in parts and subassemblies that make up the assembly. EXECUTE statements follow this sequence: EXECUTE {PART} name or variable {ASSY } input variable of design at next lower level = expression input variable..... END EXECUTE Similar to an ADD statement, an EXECUTE statement can be used in the format EXECUTE COMPONENT to interchange parts and assemblies. When specifying the component, make sure to use its extension (.prt or .asm). Note: When running a program, each part can be executed (that is, each part can receive variable values through an EXECUTE statement) only once. Avoid including conflicting instructions.
... END INPUT RELATIONS d5 = key_size d3 = depth * 1.25 END RELATIONS .... the design listing for the assembly looks like this: INPUT hole_diameter NUMBER thread_type STRING depth ... END INPUT RELATIONS END RELATIONS EXECUTE PART block_base key_size = hole_diameter/2 + 0.025 ansi_thread = thread_type depth = DEPTH ... END EXECUTE and the design for the part block_base looks like this: INPUT ADD FEATURE..... Notes:
r
The parameter key_size appears in the EXECUTE statement for the assembly and the INPUT statement for the part. This is necessary for the parameter value to be passed down from the assembly to the part. If the parameter does not appear in both places, or no EXECUTE statement is in the assembly design for the part, then those values that are currently in memory are used for the part. The parameter thread_type is set equal to ansi_thread in the EXECUTE statement, which is then passed to the part through the INPUT statement. The parameter depth is set equal to DEPTH in the EXECUTE statement, and passed to the part using the same name in the INPUT statement. This technique is often preferable to Step 2 because it is easier to keep track of the parameters. The relation d5 = key_size is not necessary; the parameter symbol d5 can instead be renamed key_size using the Symbol command in the DIM COSMETIC menu.
A warning informs you that the variable A has not been defined. You can then edit your design to correct the error. If you incorporate changes in a model ignoring the warning, the value of A is passed to a parameter with the same name in the part being executed.
Mass Properties
Use the MASSPROP statement to update mass properties each time geometry changes. Once you have specified parts or assemblies for which mass properties are to be updated, you can request the current value of a required parameter through the relations mechanism. For more information, see Mass Property Parameters. To update mass properties, use the following format: MASSPROP PART NAME ASSEMBLY NAME END MASSPROP Note: When specifying the model for which mass properties are to be calculated, enter the model name without an extension. The MASSPROP statement can contain the IF... ELSE clause. If you add a condition to the MASSPROP statement, the mass properties of an object will be calculated only if that condition is met. For example: MASSPROP IF THICKNESS > 1 PART PLATE ELSE ASSEMBLY BLOCK ENDIF END MASSPROP In the preceding example, if the parameter THICKNESS is more than 1, mass properties is recalculated for the part PLATE; otherwise, mass properties for the assembly BLOCK is calculated. Note: If you rename objects using the Rename...command on the Filemenu, you must then rename them manually in the
MASSPROP listing.
INTERACT Statements
INTERACT statements provide a place holder for creating interactive part and assembly features. They can be inserted anywhere within the FEATURE ADD - END ADD or PART ADD - END ADD statement. For example, the ELSE statement in the previous example could have been constructed as follows: ADD PROTRUSION..... IF d1 > d2 ADD HOLE..... ELSE INTERACT END IF ADD CUT..... In this example, an alternate set of features is to be created if d1 is not greater than d2. Interact mode works similarly to Insert mode accessed from Pro/ENGINEER.
Feature Suppression
Part features or assembly features and components can be suppressed by adding the word SUPPRESSED immediately following the word ADD: ADD SUPPRESSED PROTRUSION Similarly, a suppressed feature can be resumed by deleting the word SUPPRESSED from the ADD FEATURE clause.
http://silverstone.fortunecity.com/daytona/344/proehelp/fundamentals/program.htm (16 of 27)5/15/2006 5:50:06 PM
Suppression through the use of program works the same way as in regular Pro/ENGINEER (suppressed models are not retrieved when an assembly is retrieved). Therefore, suppressed models are not stored when you save an assembly with the Save As command.
Feature Dimensions
You can change the dimensions of features in the program by replacing a dimension statement with: MODIFY d# = value You can also assign a new dimension value through the RELATIONS statement.
Using Comments
You can use comments in the program to annotate relations and features. To insert comments, use the following format: /* < your comment Note that the slash and asterisk precede the comment. Also, the comment on a feature must follow its ADD FEATURE... line immediately. The comment is then attached to the feature being added, and appears in the INFO window.
Editor Errors
Editor errors that prevent Pro/PROGRAM from reading the design are caught as soon as you exit the editor. Some ways that errors can occur are:
q
Having an IF statement without an END IF statement, or vice versa. Typing a variable name incorrectly in a relation or a condition. Reordering a child before the parent. Deleting a parent feature.
If the file contains errors, the PROG ERROR menu appears with the following active commands:
q
Abort--Cancel changes that you have made to the design and keep it as it was prior to editing. Edit--Edit the design to correct errors. Error messages indicate the location and type of error. These messages are ignored during subsequent design processing; they are deleted if new errors are found and inserted into the design, or if you exit from the model.
Current Vals--When you run the program, it uses the current values without requesting your input.
Note: If you want to check the current parameter values, choose Show Design > From Model. The Information Window displays the listing with the input variables and values assigned to them in the current model design.
q
Enter--Enter new input values as prompted. Parameter selection is controlled by check boxes in the INPUT SEL menu. Pro/PROGRAM only prompts you to enter a new value for the checked parameters. Read File--When running a program, the system uses input from a file. Type a file name (including the extension, if any).
How to Select or Modify Input Parameters 1. Choose PART > Program, then choose PROGRAM > Edit Design. The system editor displays the current Pro/ PROGRAM for the model. 2. Edit the program Input list as you want. 3. Incorporate your changes into the model. 4. Choose GET INPUT > Enter. 5. In the INPUT SEL menu, select the check boxes next to the input parameters for which you want to enter values, and then choose Done Sel. 6. Enter the values, as prompted in the message area and choose PROGRAM > Done/Return.
Execution Errors
When execution errors are encountered, the system reacts as follows: In Part mode and Assembly mode:
q
If the failure is due to a feature error (for example, if a dimension violates a Relations constraint), the Information Window opens with the description of the error, which is also written to the file errors.lst.n. You can then edit the design From File (to correct the error) or From Model (to start afresh). If the failure is due to a geometry error, Pro/ENGINEER enters a special error resolution environment called the Resolve environment, which has various functions to help you diagnose and resolve the error. For more information, see Working in the Resolve Environment in the Part Modeling User's Guide.
In Assembly mode: If the failure occurs during assembly (for example, because a substituted member does not fit), the system informs you that it failed to replace the particular member and asks you if you want to reedit the program.
Feature Errors
Many errors are not detected during editing, but they still make the design unusable. They can be defined generally as invalid feature list errors. Such errors usually result from reordering or deleting features that depend on each other, or from imposing condition values on features such that a feature that should be created is missing its parent. Feature list errors are caught during execution, after the input values have been requested, but before the model geometry reconstruction has begun.
Geometry Errors
Some errors cannot be detected until the geometry reconstruction process has begun. For example, you could take the following design: ADD FEATURE PROTRUSION ADD FEATURE SHELL OF THICKNESS d10 (to make a cup) ADD FEATURE PROTRUSION (handle for cup) and reorder the last two features, which are not dependent on each other. If the geometry of the handle is too thin to be shelled with thickness d10, this creates a geometry error. Pro/ENGINEER fails to regenerate the shell. The failed feature (the shell) is highlighted in red on the model. The RESOLVE FEAT menu appears and the Failure Diagnostics window opens with information on the failed item. If you choose Undo Changes, the system undoes the changes in this regeneration and returns to the previous state. In the preceding example, this means that the feature order would be restored.
Creating Instances
http://silverstone.fortunecity.com/daytona/344/proehelp/fundamentals/program.htm (20 of 27)5/15/2006 5:50:06 PM
Parts and assemblies created through Pro/PROGRAM with input parameters can be turned into instances of the generic model. Whenever a design has been executed, either after regenerating the model or after editing the design, you can create a family instance of that specific configuration using the Instantiate command on the PROGRAM menu. How to Create an Instance of the Model 1. After executing the program, choose PROGRAM > Instantiate. 2. Pro/TABLE appears with the name of the generic model(s) (part in Part mode, assemblies and parts in Assembly mode) in column 1, and default instance name(s) in column 2. Edit the default instance name(s) for assembly and parts if desired; then exit Pro/TABLE. After you create an instance assembly, you can view the family table. It now includes the instance assembly name, part names that were executed, and variables that were entered during input. Note: The parameters that appear in the family table control the model design. Instantiating a model revises your design program slightly. For example, if an assembly program had an EXECUTE statement, an IF statement is created about the EXECUTE statement. This validates execution only for a generic assembly. The following figure illustrates how to instantiate a generic assembly and shows the finalized family table. Creating an Assembly Instance
Contents Book Index Books Products Master Index Search Print Customer Service About Help Home
Copyright 1998 Parametric Technology Corporation 128 Technology Drive, Waltham, MA 02154 USA All rights reserved
web hosting domain names video sharing online games photo sharing free blog advertising online