Professional Documents
Culture Documents
Pro/Program Background
Structure of a Pro/Program
• Inputs
• Relations
• Execute
• Body
• Mass Properties
Running Programs
Helpful Hints
Where to Find More Info
2 © 2003 PTC
Pro/Program Background
What is Pro/Program?
Pro/Program is a tool within Pro/ENGINEER to automate the
generation of similar parts and assemblies by modifying parameters.
Think of Pro/Program as relations on Steroids.
3 © 2003 PTC
Pro/Program Structure
Mass
Input Relations Execute Body Props
4 © 2003 PTC
Pro/Program Structure - Inputs
5 © 2003 PTC
Pro/Program Structure - Inputs
6 © 2003 PTC
Input Example
INPUT
THICKNESS NUMBER
INCLUDE_VALVE YES_NO
STOCK_ID STRING
...
END INPUT
______________________________________________________________________________
7 © 2003 PTC
Pro/Program Structure – Relations
• Floor
8 © 2003 PTC
Functions Used in Relations
cos() cosine log() base 10 logarithm
ln() natural logarithm
tan() tangent
exp() 1 to an exp. Degree
sin() sine
abs() absolute value
sqrt() square root
ceil() the smallest integer not less than the real value
floor() the largest integer not greater than the real value
Ex:
ceil (10.2) = 11
ceil (10.255,0) = 11
10 © 2003 PTC
Operators Used in Relations
+ Addition
- Subtraction
/ Division
* Multiplication
^ Exponentiation
== Equal to
| Or
& And
~,! Not
11 © 2003 PTC
Pro/Program Structure - Relations
Relation Tips
Add Comments to remind yourself and others what your
relations are controlling
Modify your dimensions with Logical names
• Length instead of d20, etc.
Relations are evaluated from top to bottom. Relations towards
the bottom have more precedence than those higher up.
Parameters must exist before they can be used in relations.
Maximum Line length is 80 Characters use \ to continue on a
second line. Recommended Maximum of 5 lines total.
12 © 2003 PTC
Pro/Program Structure – Execute
Syntax:
Execute ASSY sub-asm1
Input1=expression
Input2=variable
Input3=value
End Execute
13 © 2003 PTC
Execute Example
EXECUTE STATEMENT
For example, for the part block_base, the listing looks like this:
INPUT
key_size
ansi_thread
...
END INPUT
RELATIONS
d5 = key_size
d3 = depth * 1.25
END RELATIONS
....
Then the design listing for the assembly looks like this:
INPUT
hole_diameter NUMBER
thread_type STRING
depth
...
END INPUT
RELATIONS
END RELATIONS
ansi_thread = thread_type
depth = DEPTH
END EXECUTE
14 © 2003 PTC
Pro/Program Structure – Execute
15 © 2003 PTC
Pro/Program Structure - Body
Syntax:
Add Part (Variable)
...
End Add
Add Feature
...
End Add
16 © 2003 PTC
Body Editing Examples
ADD PROTRUSION.....
Assembly…..
ADD HOLE.....
ADD PART BASE_1
ADD CUT.....
....
The modified design might look like this:
IF DIA > 1.25
ADD PROTRUSION.....
ADD PART PART_A
IF d1 > d2
.....
ADD HOLE END ADD
... ELSE
END ADD ADD PART PART_B
ENDIF .....
ADD CUT..... END ADD
END ADD ENDIF
17 © 2003 PTC
Replacing Components
XYZ = <parameter_name>:fid_<feature_name>:<comp_id>
OR
XYZ = <parameter_name>:fid_<N>:<comp_id>
Example:
INPUT
fastener_name STRING
END INPUT
...
END ADD
OR
To interchange a part named washer for a subassembly or vice versa, use an ADD COMPONENT
For example:
COMPONENT ID 4
...
END ADD
18 © 2003 PTC
Replacing From a Family Table
LOOKUP_INST Statement
d1 d0 d4
RELATIONS
INSTANCE_NAME = LOOKUP_INST("333.PRT",1,"D1",X:1,"D0",Y:1)
END RELATIONS
END ADD
INTERNAL COMPONENT ID 12
END ADD
19 © 2003 PTC
UDF Replacement
CHOOSE STATEMENT
INPUT
GROUP STRING
END INPUT
CHOOSE (GROUP)
20 © 2003 PTC
Pro/Program Structure – Body
21 © 2003 PTC
Pro/Program Structure – MassProp
Use the Mass Prop statement to update the mass properties each time
Geometry Changes.
Syntax:
MASSPROP
Part [NAME]
Assembly [NAME]
END MASSPROP
Tips:
Use IF / ENDIF to classify which components get updated
If you rename an object, you must manually update the MASSPROP
area.
If you use a relation to set a parameter with the mass prop, you have
to regenerate again to update the parameter.
22 © 2003 PTC
Running your Program
23 © 2003 PTC
Helpful Hints:
24 © 2003 PTC
Need More Info:
25 © 2003 PTC
View/Application Share: Live Demonstration
[PlaceWare View/Application Share. Use PlaceWare > Edit Slide Properties... to edit.]