Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Translate the entire conversation x

How do I display only the value of a variable?

AP_12953245
2-Explorer

How do I display only the value of a variable?

I want to present results in a table I created.

But having the variable name showing when I want to display the results is really not convenient.

Anyway around that other than hiding the name with a white box?

 

I mean...

It's Mathcad...  Not Paint...

 

Thanks

12 REPLIES 12
Werner_E
25-Diamond I
(To:AP_12953245)

If you really want to display just the numerical result but want to hide the information about the associated variable name, you could use the Text Box (advanced controls) wit the variable as input (which you could hide. You could add any text you like, chose font size, color etc.

 

In (real) Mathcad we could use the symbolic evaluation because we had the options to hide the keywords and the left hand side of an evaluation. All that remained was a right arrow, though, Maybe Prime will offer this functionality, too, one day ...

 

Here is an example of using a scripted control:

Werner_E_1-1742408490697.png

 

EDIT: Following Luc's suggestion I also added an Excel component to do something similar.
I don't like using embedded Excel  components but it may be a matter of personal preference.

 

Prime 10 sheet attached

 

LucMeekes
23-Emerald III
(To:AP_12953245)

In Mathcad you could hide any part of the worksheet behind a picture:

LucMeekes_0-1742407021511.png

Here I took a picture from the Prime background and hid part of Variable. You could send items to the background or to the foreground, Obviously I sent the math region to the background.

 

In Prime that doesn't work, Pictures always seem to be transparant for math regions and you cannot send to back- or foregound:

LucMeekes_1-1742407202351.png

Here I tried to hide part of Variable with a picture part of Mathcad's background.

 

Would it help to embed an excel table in the prime worksheet and show that?

 

Success!
Luc

I have tried to use the Excel component but when trying to update it, it always tells me that Excel is busy even though there is no instance of Excel running.

Very frustrating…

Werner_E
25-Diamond I
(To:AP_12953245)


@AP_12953245 wrote:

I have tried to use the Excel component but when trying to update it, it always tells me that Excel is busy even though there is no instance of Excel running.

Very frustrating…

 


Unfortunately this happens ever so often when using the embedded Excel components.

It's quite possible that an Excel instance is still running but not visible. In this case, it might help to check the Windows Task Manager under Details to see if an Excel process is still running there, and then kill it there.

If you search the forum for "Excel busy" or the like you will find some threads where people complain about this very problem. As far as I am aware there is no final solution. Some tell that repairing the M$ Office installation cured the affect, others think that it does not work wit M$ 365 at all and you would need a "normal" Office.

I seldom use embedded Excel components because I consider them unreliable, I use a "normal" Office 2016 and from time to time I get this annoying "Excel is busy and needs to be started.." . I am not sure why and how to reliably reproduce the error.

 

BTW, I edited my answer above and attached a modified sheet which additionally includes an Excel component. Maybe you want to give it a try and have more luck doing so.

ttokoro
21-Topaz I
(To:LucMeekes)

On the screen math with BackColor 250.250.250 can hide the name. But if print it appears.

image.pngimage.png

Werner_E
25-Diamond I
(To:ttokoro)


@ttokoro wrote:

On the screen math with BackColor 250.250.250 can hide the name. But if print it appears.


The correct color is 246.250.246  😉

But its very uncomfortable that we now would have to manually set the color black to all variables in calculations we want to see.

I don't think that's a very useful 'solution' , although it depends on what exactly the questioner wants to achieve and aim for.

BTW, for me the variable won't appear in print either.

But then maybe I misunderstood what you meant by "Math Backcolor" because you only show pictures. I assumed that you changed the font color of label "Variable".

Guys,

I was able to do what I wanted using Excel Components.

It lets me create a table and display variables without their names.

Tks
Alex
SPaulis
14-Alexandrite
(To:AP_12953245)

@AP_12953245 I see that you want the results in a table but to remove the variable because it is redundant. 

 

I have a suggestion that I use quite often to display a not-so-large tables of results.  I compile my results to a matrix and add row and/or column headers directly.  I still have to use a variable but you can always use a short variable.  In the end it's about displaying results in a grid .  If the matrix is too wide, then maybe transpose it and modify your headers.  

 

My input data uses the nicely formatted "table" feature (I wish my output looked similar):

SPaulis_1-1742487597739.png

 

And here is my summary table after all the calculations are done.  In the summary table I only need to know the D/C values for each check and I use the OK/NG text because, for me at least, it is easier to spot the problems.  I sure wish we had coloured extended ascii characters as the Mathcad font.

 

SPaulis_0-1742487045491.png

 

I just tried transposing the table and quite frankly I like this summary table better for this calculation sheet.  I usually do not have that many scenarios, but I can spot the problems even easier.  As you can see, the direction of the table is up to you to make the output look best:

 

SPaulis_0-1742488466319.png

 

 

One problem I have is if I have multiple columns of different units.  Mathcad does not allow you to choose your default units other than the base dimensions in SI, US and CGS.  In those cases, you may want to strip the units and add the units as text in your header row/column.

There are multiple user requests about having formatted output tables, similar to the input tables.  As an example, see https://community.ptc.com/t5/Mathcad-Ideas/Tables-Results-Tables/idi-p/470236.  Maybe you can help out by up-voting some of these ideas so that PTC will see the importance of the idea.

Shawn P.
“It’s OK to fall in love with your heart. But, when it comes to making engineering decisions, don’t design with your heart.” – Blodgett, Omer W.
LucMeekes
23-Emerald III
(To:AP_12953245)

OK, I gave it another shot.

How's this:

LucMeekes_0-1742494773384.png

and printed:

LucMeekes_1-1742494809113.png

I suppose, if you switch off the grid display it will not print either.

 

Prime and pdf files attached.

Success!
Luc

Werner_E
25-Diamond I
(To:LucMeekes)

I consider this quite uncomfortable as this method makes all instances that are labelled as ‘variables’ disappear and they would have to be made visible again manually by recolouring them - very tedious!
But I can confirm that this method works in the printout as well.

 

BTW, you can only make them vanish completely either in print when you choose pure white (255:255:255) as you did OR on screen by choosing the Prime background color 246:250:246 🙂

 

But I have the feeling anyway that the questioner quickly loses interest and leaves his threads orphaned -> How do I get Mathcad to give me ...

LucMeekes
23-Emerald III
(To:Werner_E)

"Very tedious": I tend to disagree.

The sheet can just be set up normally, with ordinary colours for each of the label styles. Then just before printing, change the colour of the Variable label style to white, so they all become white; that is in one go. Then print, and after print set the colour of the Variable label style back to the original colour and all is readable again.

I only coloured the assignment black, so it would remain visible, but I guess that isn't necessary for the OP. I suspect he wishes to use this to print calculation results on a preprinted form, where locations (boxes?) are reserved for the values needed.

 

Luc

 

 

Werner_E
25-Diamond I
(To:LucMeekes)

We don't actually know what @AP_12953245  finally had in mind so its only him who could say which approach is most suitable for his needs (if he still is interested at all).
I was thinking of a report where the calcs would be visible throughout and at the end in the conclusion the final results should be displayed in a nicer way, maybe with explanatory and connecting text where variable names and equal sign would be disturbing. In this scenario it would be necessary that the variable names in the calculations remain visible.
But of course we could help ourselves by printing twice, first the calculations without the summary page(s) with black variable names and then just the summary page with white ones - equal signs and a distance in front of it (the white var name) would still remain, though.

So which way to go depends upon what the final goal should be.

Announcements

Top Tags