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.

INPUT STATEMENT IN PRO/PROGRAM

otman73

New member
I'm trying to have Pro/Program prompt those additonal input only when needed but not working right for some reason. ALL the input parameter shows up as a option to choose when I regenerate. Any idea?

INPUT
PURGE_PORT_QTY NUMBER
"NUMBER OF PURGE (2=TWO, 3=THREE, 4=FOUR)"

IF PURGE_PORT_QTY == 2
PURGE_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE PURGE? "
ENDIF

IF PURGE_PORT_QTY == 3
PURGE_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE PURGE? "
DRAIN_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE DRAIN PORT? "
ENDIF

IF PURGE_PORT_QTY == 4
PURGE_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE PURGE? "
DRAIN_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE DRAIN PORT? "
FLUSH_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE FLUSH PORT? "
ENDIF

END INPUT

Edited by: otman73
 
I'd try this:


INPUT
PURGE_PORT_QTY NUMBER
"NUMBER OF PURGE (2=TWO, 3=THREE, 4=FOUR)"
PURGE_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE PURGE? "

IF PURGE_PORT_QTY> 2
DRAIN_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE DRAIN PORT? "
IF PURGE_PORT_QTY == 4
FLUSH_ANGLE NUMBER
"WHAT ANGLE DO YOU WANT THE FLUSH PORT? "
ENDIF
ENDIF

END INPUT



Rodney Decker


WF3 M140
Edited by: r.decker
 
Thanks for the reply. I try it out but still with same result.
smiley5.gif
 
I think it should work if you regen and select all for input regeneration. It will work through your input statements and then only prompt you based on the result of the first input.
 
Wow! You are correct! I went back and did it with my code & r.decker code and they both work. I like r.decker code better since is cleaner. Thank you very much! I never thought about "select all" kind of an odd way for it too work but this is not a surprise to me since I'm finding odd things about PROE as I learn it. Now I have to go figure out how to tie those if statement into my execute command
smiley32.gif


This forum Rock! I'm sure I'll be back with more question
smiley4.gif
 
Glad to help out.

What did you mean by this statement?
"Now I have to go figure out how to tie those if statement into my execute command"
 
IF PURGE_PORT_QTY> 2
DRAIN_ANGLE NUMBER

"WHAT ANGLE DO YOU WANT THE DRAIN PORT? "

IF PURGE_PORT_QTY == 4

FLUSH_ANGLE NUMBER

"WHAT ANGLE DO YOU WANT THE FLUSH PORT? "

I figured it wouldn't be that simple to pass those variable down to my part but I'll soon find out
smiley36.gif
 
Glad you answered Nate. After reading my post I realized I forgot the bit about select all and started another post. I guess I got distracted before submitting--stupid work<?:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> </v:stroke></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:ulas></v:path><?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shape>
smiley17.gif
</v:image></v:shape>


We use the select all option a lot as many of out programs have 30+ input variables. With the use of If statements it does help streamline inputs as certain options will eliminate others. Here'sa shortexample of what we'll have:


INPUT
STANDARD YES_NO
"IS CONSTRUCTION STANDARD (Y/N)"
LENGTH NUMBER
"ENTER LENGTH"
WIDTH NUMBER
"ENTER WIDTH"
IF STANDARD==NO
CUSTOM_VAR1 NUMBER
"ENTER CUSTOM VARIABLE VALUE"
CUSTOM_VAR2 STRING
"ENTER CUSTOM VARIABLE VALUE"
IF CUSTOM_VAR2=="SPEC. STRING"
CUSTOM_VAR3 NUMBER
"ENTER CUSTOM VARIABLE VALUE"
etc...
ENDIF
ENDIF
END INPUT


RELATIONS
IF STANDARD==YES
PAR1=3
PAR2="STANDARD"
PAR3=0
ELSE
PAR1=CUSTOM_VAR1
PAR2=CUSTOM_VAR2
PAR2=CUSTOM_VAR3
etc...
ENDIF
END RELATIONS
EXECUTE PART A
LENGTH=LENGTH
WIDTH=WIDTH
VAR1=PAR1
VAR2=PAR2
VAR3=PAR3
etc...
END EXECUTE
 
I see what you mean but still an odd way to do it. I just lost about a day worth of program I was working on
smiley19.gif


NOTE to Self: never click on delete all version thinking it would keep the one you have open
smiley18.gif
 
I learned that the hard way too. Perhaps a bit of a rant, but why would that option be right next to what is essentially the purge command? I've always thought that dangerous.


Good luck on the recovery otman.


Rodney
 
I Second that! That's just as bad as accidently hitting the red X button and loosing all the work you have done. Can somebody tell me the reason why it was set up this way instead of it prompting you to save changes before closing like most normal program?

I was poking around the trail files and found a lot of the program in there but I had to redraw the parts oh well, live and learn. Job Security baby
smiley4.gif


Thanks again for your help guys and I'll be back with more question later
smiley2.gif
 

Sponsor

Articles From 3DCAD World

Back
Top