Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How do you show the result of a function without showing the name 1

Status
Not open for further replies.

lmenich

Structural
Apr 29, 2008
14
CA
In my design sheets I want to append a series of calculations with something like "ok" or "x > y, OK", but am not sure how to do this without ending up with something like: F= "OK".

Is there any way to do this? Can I make a function off to the side and somehow call it without displaying the name of the function?

Thanks.
 
Replies continue below

Recommended for you

You could create an "Area", put the calculations you want to hide in the "Area", then "Collapse" the "Area", and if desired, "Lock" it with a password, so that the hidden calculations can not be viewed without a password.

You can display the result of the hidden calculations outside the "Locked Area", so the result can still be seen, but the working can not. Just use a syntax like this to assign a result in the hidden working:

Result := MyFunction (parameter1, parameter2, ...)

Then below the hidden area, use syntax like this to display the result:

Result =

and you should get the output displayed something like this:

Result = "OK"

but the function used to generate the result won't be displayed.

Search the Mathcad Help file for "Grouping and Protecting Information with Areas" for more information.

We use this method to hide calculations which contain a lot of sensitive Intellectual Property, but we only distribute the printed / PDF output, NOT the native Mathcad file, because I am never too sure how secure such password protection schemes are, but it should be good enough to hide the working from casual "prying eyes". (I know there are password crackers for Excel, and I suspect the same can be done with Mathcad passwords, if you know how.)

Another approach is to put all the calculations you want to keep hidden on the right side sheet of the formatted output, and select "Print single page width" on the "Page Setup" menu. This only affects the printed output, but again, if you are only distributing "hard copy", it will have the desired effect.

Hope this helps!
 
To display a result without displaying the name of the function you can use a text box. Go to Insert > Control > Text box. Right click on the box, then remove output variable, and add input variable. Then edit the script to read TextBox.Text = Inputs(0).Value. Then right click the text box again and select hide arguments.

Peter
 
Another option is to assign a picture (bitmap) of the tick (OK) or cross (X) etc. Then display the picture. You can hide the arguments for a picture.

Philip
 
I like to see what test caused the result. So, I use an "if" statement. It ends up looking like this:

if([ø]M[sub]n[/sub]>M[sub]u[/sub],"O.K.","N.G.")=O.K.

 
There's a guy on the Mathcad Collab that used to post GIFs of stuff with tricks. One trick is to use an invisible font for the variable being displayed. This would leave you with

=xyz

as the only thing visible.

TTFN

FAQ731-376
 
What I do is BucklingStrength: if(øMn>Mu,"O.K.","N.G.") and then lower down I use BucklingStrength=
 
You can also assign the function output to an Excel component, and by right clicking the context menu, select "Hide Arguments", you wind up with the result in a displayed cell and no sign of the function or formula.

TTFN

FAQ731-376
 
 http://files.engineering.com/getfile.aspx?folder=45536ce4-aa51-453c-a47d-a81b5d98c5aa&file=Test_Hide_Argument.mcd
Oh, and with the Excel component approach, you can also apply conditional formatting, so that you get [green]OK[/green] and [red]NG[/red]

TTFN

FAQ731-376
 
pstuckey,

I've been trying for years to do something like this. kudos! I can use this method to to display all kinds of errors and other messages. And they don't have those ugly quote marks that I get with text variables.

My only disappointment is that somewhat ugly box that appears around the text. But I think I can live with that.

Thanks for a great tip.


regards,


chichuck

 
Actually when you use the text box you can go to the properties area and remove the box around the text! Just right click the box, and go to Mathsoft text box control object > properties > extended styles and mine generally comes up as client box, so just deselect that.
 
imerich,

I was fiddling with it and I found that. Now I can make the messages look just like I want them to. If only I could conditional format them to be green when its okay and red when its ng, or make it disappear with a white font on a white background when not needed, then I couldn't ask for more!

 
Read IRStuff's 6/25 post.
Oh, and with the Excel component approach, you can also apply conditional formatting, so that you get OK and NG
 
you can add this line before your result:

TextBox.Forecolor = RGB(0,0,225)

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top