Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

warning dialogue box 3

Status
Not open for further replies.

rxpartha

Mechanical
Apr 6, 2005
34
I have a question on disaplying error/warning dialogue boxes in Pro/E 2001. I am working on a model where the user need to input some values & the pro/e model regenerates according to the input. I am using the 3 inputs and say want to display a dialogue box (warning box) if the user enters value beyond the specified range and also to display in the same box the allowable range he/she can enter. I dont know how to ask Pro/e to show up this warning dialogue box. Can I use relation between these parameters to get this????? Any help would be appreciated. Thanks, Raj.
 
Replies continue below

Recommended for you

Raj,
I don't think you are going to be able to have a msgbox/warningbox like you can with Vb/vba... maybe thru proprogram...have my doubts.

What you could do is put in a relation based on some if
statements.. that if it is less than a value then it will set to the min. ..if it is greater than set the max. val
you may also have to assign a second parameter so that the one use use to edit is not relation driven...make sense?


as far as displaying the ranges... you could use model parameters and display those in the model tree... naming the parameter something that is related ... maxwidth & minwidth
etc.
 
Raj,

I don't have time to solve your problem for you but you can look in faq554-970 for a starters

Best Regards,

Heckler
Sr. Mechanical Engineer
SW2005 SP 4.0 & Pro/E 2001
Dell Precision 370
P4 3.6 GHz, 1GB RAM
XP Pro SP2.0
NIVIDA Quadro FX 1400
o
_`\(,_
(_)/ (_)

"There is no trouble so great or grave that cannot be much diminished by a nice cup of tea" Bernard-Paul Heroux

 
Weblink allows you to enter the values from the embedded browser, and you can use html/java to control the range of input values.
 
What is that Pro/Toolkit, I dont think we have it...and thanks for responses - Raj.
 
"Weblink allows you to enter the values from the embedded browser, and you can use html/java to control the range of input values"

Is there any source that explains in much more detail or could be please enumerate more on this.

Does any one have dont this kind of stuff.....with warning box getting displayed....I have to do this for my work here....thats why I so keen on this, if any one had done using Pro/Program or VC coding - Pro/E combination just throw some light.....thanks Raj.
 
ProToolkit is the programming module of Pro/E (API functions written in C language you can access internal data)

-Hora
 
I have decided to go with Pro/Program, anyone has any experience using this can just throw some sample programs and how do you run those programs....as this is the first time I am going to work with Pro/Program......help....needed...Thanks, Raj.



By the way a general question how do you find which module are installed in the Pro/E system...say Pro/Program or Pro/Toolkit etc.....
 
Look in your license file.


"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
Toolkit was what I was thinking of, not ProProgram.
There isn't much info on the web about it, mostly sites selling what they have developed.

There is a forum at ptcuser.org on toolkit.. you need to be reg. there to access it . 7 messages in the past month, not too many replys... but then they could be direct replys.

Not trying to refer everyone to the other group as I feel this one is great, but it is there.

I guess there is a C complier out there for free... I don't do C ....APIs calls are tricky enough in VB.. there is a site that does mention using Vb for this..no docs ... it could be done with VB and mapkeys but not near as eloquent

Raj, so Do you know C ? have access to it ? and how much time is work going to allow you to pursue this?

Hora is the ToolKit wiz :)
 
Raj, if this doesn't make your head hurt. like it does mine
your on your way :)... sample code for toolkit



have an issue with opening a drawing with view only mode. But I am getting it, may be I am wrong. Can anybody please guide me to acheive that. Fyi, I am attaching my code herewith.

#include "stdafx.h"
#include <stdlib.h>

extern "C"{
#include <ProCore.h>
#include <ProNotify.h>
#include <ProDrawing.h>
#include <ProDimension.h>
#include <ProUtil.h>
#include <ProMdl.h>
}

ProError ProMdlRetrievePre(ProPath path, ProFileName file_name, ProFileRetrieveOpt **p_retr_options_arr)
{
static ProFileRetrieveOpt arr[]= {PRO_RETRIEVE_OP_VIEW_ONLY}; // Setting to View_Only Mode.
(*p_retr_options_arr) = arr;
return PRO_TK_NO_ERROR;
}


int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
ProProcessHandle proe_handle;
ProError err;
ProBoolean random;
ProMdl mdlHandle;
ProMdldata mdlData;
ProName current_name;
//ProFileName fileFullName;
ProFamilyName fileFullName;

//char proe_command[PRO_NAME_SIZE];
char current_name_in_c[PRO_NAME_SIZE];

//FIX ME: Pro/E Command should be get from user.
//ProStringToWstring(proe_command, "proengg");

//Try to connect to Pro/E if it already running
err = ProEngineerConnect("",NULL,NULL,"",PRO_B_TRUE, 100, &random, &proe_handle);

//If not, start a new Pro/E Session.
if(err != PRO_TK_NO_ERROR)
{
err = ProEngineerStart("proengg", NULL);
err = ProEngineerConnect("",NULL,NULL,"",PRO_B_TRUE, 100, &random, &proe_handle);
}

//If fails notify the user
if(err != PRO_TK_NO_ERROR)
{
printf("%s\n","Error occured while connecting to Pro/Engineer.");
return -1; // failure
}

printf("Connection to Pro/Engineer established.\n");

ProStringToWstring(fileFullName, "c:\\bd857749-03e4-49a8-b056-536d.drw");

//Set the property PRO_RETRIEVE_OP_VIEWONLY
ProNotificationSet(PRO_MDL_RETRIEVE_PRE, (ProFunction)ProMdlRetrievePre); //Using Call back to change mode to View_Only

//err = ProMdlLoad(fileFullName, PRO_MDL_UNUSED, PRO_B_FALSE, &mdlHandle);

err = ProMdlRetrieve(fileFullName, PRO_MDL_DRAWING, &mdlHandle); //Getting TK_GENERAL_ERROR

//Check the model loaded sucsessfully.
if(err != PRO_TK_NO_ERROR)
{
printf("%s\n","Error occured while opening the specified document.");
return -1; // failure
}

ProMdlDisplay(mdlHandle);
ProMdlDataGet(mdlHandle, &mdlData);
ProMdlNameGet(mdlHandle, current_name);
ProWstringToString(current_name_in_c, current_name);

printf("%s\n", current_name_in_c);

ProMdlErase(mdlHandle);

ProEngineerDisconnect(&proe_handle, 10);

return(0);

}
Any sugessions???
 
Cadcam guy, Yup I know 'C' Programming decently...I think my stuff is simple to do but thing is that I need to know how to use Pro/Program or using C for these kind of automation stuff....If you have any examples that shows how to control a models parameters thru 'C' or anyways that would be great.

my stuff is as simple as....

User:
Enter the Entry Discharge Angle: here he/she enters the value....

Enter the Mid-discharge anle: here he/she enters the value....

As soon as they enter the model regenerates.....

Might be instead of using those warning dialogue boxes I could just say it while they enter itself..like....

Enter the Entry Discharge Angle (range ->> 0-20 degree, anyother angle entered would reset the value to zero) : here he/she enters the value....

so by this way I can prevent these crappy warning boxes...

but I just need to program these user inputs and thats what all I need is......Instead of messing the user with the model if he/she is able to enter as a value that would be easy.....Thanks, Raj.

 
ohhhhhhhhhh no way of toolkit.....think C or Pro/Program wud suffice for my purpose....raj
 
message awhile back

CONFIGPROinc (Computer) 7 Mar 05 12:43
Hello, I am an expert in Pro/PROGRAM ... if you have any questions about it let me know. I have worked for PTC for many years and can give you advice.

Emil Balogh
emilbalogh@configpro.ca
 
Try using layout functionality. Create a page where you input all values needed for your model. Transfer these values to parameters in your parts and you got an automatic regeneration of your model. Nice and clean.


ProToolkit will give you a lot of pain if you never used it. An you'll find no info about this on the web.


For your stuff, stay with ProProgram or explore Layout functionality which gives you more power in terms of data input.

-Hora

 
This is a job for Pro/Program and Relations for sure... My bosses would have a fit if I tried to do this with Pro/Toolkit.

Your Pro/Program code should look something like:

-----------------------------------
INPUT

DISCHARGE_ANGLE NUMBER
"What is the Discharge Angle?"

MID_DISCHARGE_ANGLE NUMBER
"What is the Mid-Discharge Angle"

<...Continues on for the rest of the parameters...>

END INPUT



RELATIONS

DISCHARGE_ANGLE >= 40 <--- This is what will cause a warning box to pop up. Use these inequalities to set your range.

IF DISCHARGE_ANGLE >= 40
D123 = DISCHARGE_ANGLE <--- This is what gets your dimension equal to your parameter
ENDIF

<..and so on... your program will probably be a little more complex, but the basic syntax is here>

END RELATIONS

<The rest of the Pro/Program should be left as it was in this case.. you can put IF...ENDIF statements to control feature regeneration as well>
------------------------------------------------

Where it says: DISCHARGE_ANGLE NUMBER refers to the parameter name first, and then its type (NUMBER, STRING or YES_NO)
The line following that allows you to set the input prompt.

Within the relations, the inequality will pop up a warning box if the value is invalid. You will be given the option (upon regen) to abort the changes, or go ahead with them. So that way if someone enters an invalid value, Pro/E will let you know every time it regenerates that the model's constraints have not been met.

Higher level control would require something more complex like a Toolkit app or J-Link, but in most cases that would be overkill.

Hope it helps [smile]
 
Thanks, Yup I made it work....but one thing still is

INPUT
DISCHARGE_ENTRY_ANGLE NUMBER
"ENTER THE DISHARGE ENTRY ANGLE?"
END INPUT

RELATIONS
DCHG_ANGLE=DISCHARGE_ENTRY_ANGLE (<--- This is what gets my dimension equal to parameter)
IF DISCHARGE_ENTRY_ANGLE > 15
DCHG_ANGLE = 0 (actually resets the value to zero degrees)
ENDIF
IF DCHG_ANGLE < -15
DCHG_ANGLE = 0
ENDIF

But the problem is if I enter more than +/- 15 it the inequality doesn't pop up the warning box as per your say....

but what it does is, if I enter 17 then it regenerates the whole model and sets the value(DCHG_ANGLE) to zero....
but doesn't show any error as I enter beyond my range of
+/-15. It woud be great if that warining pops up.....

Thanks a lot for all the responses, this is one of the best & most helpful forum I have seen. You guyz rock....I sincere appreciation to all the responses. Thanks, Raj.
 
A bit more work on the relations part and you should be on your way...

...

RELATIONS

DCHG_ANGLE < 15
DCHG_ANGLE > -15
These two inequalities constitute "constraints". If they are untrue, you will get the warning dialog

IF DISCHARGE_ENTRY_ANGLE < 15
IF DISCHARGE_ENTRY_ANGLE > -15
DCHG_ANGLE = DISCHARGE_ENTRY_ANGLE <--Now you equate it to the parameter
ELSE
DCHG_ANGLE = 0 <--Otherwise, it is zero
ENDIF
ENDIF

Nested IF statements sound about right for your case

..... and so on..

Hope it works out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor