Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

pro/program language

the shaunfather

New member
so i am starting a new project using pro/program to eventually set parameters for design of a part specific to a customer's need.i know, sounds familiar. only problem is, my programming experience is fairly limited.


the question is, what language is used in pro/program? i am fairly familiar with java and c, and i'm sure that those will help, i'm just looking for an idea of what program is capable of being told what to do.
 
so i'll mostly be using IF and ELSE? is it possible to use AND or OR operators? sounds easy enough to me...


should be fun rooting around with a stick, seeing what kind of failures i can cause while trying to debug...
 
Yes AND OR
Arithmetic Operators:
^ Exponentiation 1st
* Multiply 2nd<?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" />
/ Divide 3rd
+ Add 4th
<H3 style="MARGIN: 0cm 0cm 0pt; tab-stops: 36.0pt">- Subtract 5th</H3>
<H3 style="MARGIN: 0cm 0cm 0pt; tab-stops: 36.0pt">() Grouping</H3>
<H3 style="MARGIN: 0cm 0cm 0pt; tab-stops: 36.0pt"></H3>
<H1 style="MARGIN: 0cm 0cm 0pt; tab-stops: 36.0pt">Assignment = Equals</H1>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"></H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">Comparison Operators: </H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">== Equal to</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">!= Not Equal to</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><> Not Equal to</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">> Greater Than</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">< Less Than</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">>= Greater Than or Equal to</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><= Less Than or Equal to</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">& And</H3>
<H3 =Msonormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify">| Or</H3>


Debugging is rather easy the model will fail and then you go and find it
 
You can find the info you want in the help center under MODEL ANALYSIS > PRO/PROGRAM.


Below I have a part example in black and explanatioins in blue:


Between INPUT & END INPUT you create the input parameters for your part or assembly. The format can be one or two lines. The second line is displayed in Wildfire's message area. The current value will display if the parameter is in (...) as shown but it is optional. These parameters can be used anywhere in the part or assembly including the relations.
INPUT
NROFBL NUMBER = 70.000000
"(NROFBL), ENTER THE NUMBER OF BLADES IN THIS ROW"
.
.
.
ROTATION_CCW YES_NO = NO
"(ROTATION_CCW), SHAFT ROTATION"
TNDIA NUMBER = 0.000000
"(TNDIA), DIA OF TENON(S) (NONE=0)"
TWBOSSWDTH NUMBER = 0.187000
"(TWBOSSWDTH), WIDTH OF BOSS (NONE=0)"
DWG_SYMBOL STRING = "TF300"
.
.
.
END INPUT


The relations are also shown. Not all parameters need be listed above, only those that need a value from outside. Below are two ways that I commonly evaluate user input to simplify the IF/ENDIF statements which wrap around the acutal features.


RELATIONS
.
.
.
/* CHOOSE THE SHROUD FASTENING SYSTEM
IF TNDIA > 0 & TWBOSSWDTH == 0
SHRD_TYPE= "TENON"
ELSE
IF TNDIA == 0 & TWBOSSWDTH > 0
SHRD_TYPE= "TIEWIRE"
ELSE
SHRD_TYPE= "NONE"
ENDIF
ENDIF


These arelike searching an array.


/* DETERMINE THE FASTENER TYPE FROM THE SYMBOL PREFIX
IF SEARCH("TB TF TG", FSTNR_SYM) > 0
FSTNR_TYPE = "TREE2"
ELSE
IF SEARCH("TM TN TT TW", FSTNR_SYM) > 0
FSTNR_TYPE = "TREE3"
ELSE
IF SEARCH("RA RB RC RF RG RH RJ TA", FSTNR_SYM) > 0
FSTNR_TYPE = "TSHANK"
ELSE
FSTNR_TYPE = "UNKNOWN"
ENDIF
ENDIF
ENDIF
.
.
.
END RELATIONS


After relations, each feature (or component in assemby) is listed. Here you can add if/else/endif statements to control the state of any feature or component (suppressed or resumed for parts, included or excluded for components).


Note: If you insert a feature between an IF & ENDIF Pro will break the statements so that the new feature will be outside the IF/ENDIF.


IF SHRD_TYPE == "TIEWIRE" &FSTNR_TYPE == "TREE2"
ADD FEATURE 1
INTERNAL FEATURE ID 1
.
.
.
DATUM PLANE


END ADD
ENDIF


IF SHRD_TYPE == "TIEWIRE" | FSTNR_TYPE == "TSHANK"
ADD FEATURE 2
INTERNAL FEATURE ID 4
.
.
.
DATUM PLANE
ENDIF
END ADD



You will encounter a special problem in assembly. If the assembly has inputs and the parts have inputs you will have to regenerate each one separatly. Also how to share common values among the parts?


Pro/E solves with with the EXECUTE/END EXECUTEstatement which I show below:



IF B2B_LSV_1D == 2
EXECUTE PART LS_VANE
MET_UNITS = MET_UNITS
ROT = ROT
IMP_OD = IMP_OD
ALFALA = ALFALA
BRR = BRR
END EXECUTE
END IF


The IF/ENDIF is optional, but recommended if the component is also wraped in IF/ENDIF statements. This EXECUTE statement should appear in the assembly which contains the part LS_VANE *after* the END RELATIONS statement. I like to group them all above the first assembly feature or component, but it doesn't matter to Pro.


What this does is transfer the parameter values down one level. So if the PART contains a parameter BRR, create an identical parameter in the assembly (for simplicity's sake). If the PART has five parameters but you only EXECUTE four, Pro will require you to regenerate the PART anyway, therefore EXECUTE all parameters.


BTY you can also EXECUTE sub assemblies with:


EXECUTE ASSEMBLY [assembly name]...


Hope this helps.
 
copyboy said:
You can find the info you want in the help center under MODEL ANALYSIS > PRO/PROGRAM.


Below I have a part example...


<valuable information...>


...Hope this helps.


This is great stuff. I've been searching the 'net for a few days now looking for stuff like this. Thanks for the help!!!


--Geoff
Edited by: ProE_Jedi
 

Sponsor

Back
Top