Pro/PROGRAM Tutorial

 

Assume a simple part was created with a simple extruded protrusion and a hole feature as shown:

 

Selecting Program – Show will display everything that Pro/E needs to build that geometry as you defined it.

 

VERSION

REVNUM 169

LISTING FOR PART DEMO_PROGRAM

 

INPUT

END INPUT

 

RELATIONS

END RELATIONS

 

 

 ADD FEATURE 1

 INTERNAL FEATURE ID  1

 TYPE = DATUM PLANE

 NAME = RIGHT

 

 

    FEATURE IS IN LAYER(S) :

      01___PRT_ALL_DTM_PLN - OPERATION = SHOWN

      01___PRT_DEF_DTM_PLN - OPERATION = SHOWN

 

 END ADD

 

 

 ADD FEATURE 2

 INTERNAL FEATURE ID  3

 TYPE = DATUM PLANE

 NAME = TOP

 

 

    FEATURE IS IN LAYER(S) :

      01___PRT_ALL_DTM_PLN - OPERATION = SHOWN

      01___PRT_DEF_DTM_PLN - OPERATION = SHOWN

 

 END ADD

 

 

 ADD FEATURE 3

 INTERNAL FEATURE ID  5

 TYPE = DATUM PLANE

 NAME = FRONT

 

 

    FEATURE IS IN LAYER(S) :

      01___PRT_ALL_DTM_PLN - OPERATION = SHOWN

      01___PRT_DEF_DTM_PLN - OPERATION = SHOWN

 

 END ADD

 

 

 ADD FEATURE 4

 INTERNAL FEATURE ID  39

 PARENTS = 1(#1) 3(#2) 5(#3)

 

 PROTRUSION: Extrude

 

 NO. ELEMENT NAME    INFO                                            STATUS

 --- ------------ -----------                                        ------

  1  Attributes   One Side                                           Defined  

  2  Section      Sk. plane - Surface FRONT of feat #3 (DATUM PLANE) Defined  

  3  Direction                                                       Defined  

  4  Depth        Blind, depth = 3                                   Defined  

 

 SECTION NAME = S2D0001

 

 

 FEATURE'S DIMENSIONS:

 d0 = 6.000

 d1 = 10.000

 d2 = 12.000

 d3 = 20.000

 d4 = 3.000

 END ADD

 

 

 ADD FEATURE 5

 INTERNAL FEATURE ID  74

 PARENTS = 1(#1) 3(#2) 39(#4)

 

 

 HOLE

 

  NO.       ELEMENT NAME       INFO                                             

  ---       -------------      -------------                                   

   1        Hole               Defined                                         

   1.1      Hole Type          Defined                                          

   1.2      Diameter           Defined                                         

   1.3      Depth              Defined                                         

   1.3.1    Side One           Defined                                          

   1.3.1.1  Side One Depth     Thru All                                        

   1.3.2    Side Two           Defined                                         

   1.3.2.1  Side Two Depth     None                                             

   2        Placement          Defined                                         

   2.1      Primary Reference  Defined                                         

   2.2      Placement Type     Linear                                          

   2.3      Linear Reference   Defined                                         

   2.4      Distance           8.0000                                          

   2.5      Linear Reference   Defined                                         

   2.6      Distance           5.0000                                          

 

 PLACEMENT = LINEAR

 

    FEATURE IS IN LAYER(S) :

      02___PRT_ALL_AXES - OPERATION = SHOWN

 

 FEATURE'S DIMENSIONS:

 d5 = 2.000 Dia

 d7 = 8.000

 d8 = 5.000

 END ADD

 

MASSPROP

END MASSPROP

 

 

 

We can modify this “program” such that data can be used that comes from a ASCII text file or from the user entering specific data during regneration.

 

Assume we create a text file (outside of Pro/E) that looks like the following:

 

/* comment

CORNER_CUT = 6.000

LENGTH = 20.000

 

The first line is a comment, and can be anything.  The next two lines define “variable names” and have associated values.

 

Assume that Pro/E will eventually read this file.  Therefore, inside of Pro/E, do a Program – Edit Design and make changes such that the program reads as follows:

 

VERSION

REVNUM 169

LISTING FOR PART DEMO_PROGRAM

 

INPUT

CORNER_CUT  NUMBER

LENGTH            NUMBER

END INPUT

 

RELATIONS

d0=CORNER_CUT

d3=LENGTH

END RELATIONS

 

Notice that the input area is going to read information called Corner_Cut and Length.   This was keyed into the INPUT block.  Since Pro/E has no idea what this really is, we can add some relations (in the program) in the RELATIONS block.  We told the computer what values the symbolic values should be by entering information here.

 

File this and now we can use this “program”

When you select Regenerate, you will get new choices now.

 

 

Current Vals does just what you would expect.

 

Enter will bring up a menu as follows:

 

You can select what “items” you want to change.  Check both boxes and pick on Done Sel.  If you don’t change both values on the first regenerate, the system thinks that one of the values is 0 and will cause a regeneration failure.

 

 

 

As soon as you hit the check mark, the system regenerate the model to appear as follows:

Now, let’s change the design back to the “original” by regenerating by selecting Read File.

 

Key in the file name exactly as it was saved on disk INCLUDING THE EXTENSION.  The model will regenerate with the values defined in the file.

 

If you are confused on the file extension, remember that the machines in the lab will not show extensions for known file types.  To change this, in Windows Explorer, select Tools – Folder Options – Type and uncheck the box labeled Hide File Extensions for Known File Types.

 

 

 

If you Show Design, now that you have edited the program, you will now see current values in the output as shown.

 

VERSION

REVNUM 186

LISTING FOR PART DEMO_PROGRAM

 

INPUT

 CORNER_CUT NUMBER = 6.000000

 LENGTH NUMBER = 20.000000

END INPUT

 

RELATIONS

D0=CORNER_CUT

D3=LENGTH

END RELATIONS