cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Highlight Color of Results

mgkoenig
1-Newbie

Highlight Color of Results

I am calculating the bending stress of pipe depending on the type of Horizontal Directional Drill. I would like to change the highlight color of the results. For example, If the bending stress passes I have the highlight as yellow, but if it fails I want the highlight as yellow.

Mark Koenig
18 REPLIES 18

Typo in original email. If the result "fails" I want the highlight color as red.

Mark Koenig

We can do it thru a text box control and scripts connected with the text box.
Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm
ELSID
4-Participant
(To:ValeryOchkov)
StuartBruff
23-Emerald II
(To:mgkoenig)

On 11/2/2009 2:44:00 PM, mgkoenig wrote:
== I am calculating the bending stress of pipe depending on the type of Horizontal Directional Drill. I would like to change the highlight color of the results. For example, If the bending stress passes I have the highlight as yellow, but if it fails I want the highlight as yellow.

Try the following

Stuart

Thanks Stuart.

I tried the script and still could not get it to work. If you change the angle (I1 which is 87.1 deg) to 60 deg the result will fail, but the script keeps the color yellow and the word "PASS". Not sure why?

Thanks agian,

Mark Koenig
StuartBruff
23-Emerald II
(To:mgkoenig)

On 11/3/2009 9:13:32 AM, mgkoenig wrote:
== I tried the script and still could not get it to work. If you change the angle (I1 which is 87.1 deg) to 60 deg the result will fail, but the script keeps the color yellow and the word "PASS". Not sure why?

No, I can't explain it either - I've downloaded the worksheet to my M13 PC, changed I1 to 11 deg and I get both text boxes turning red. I can't remember whether I tested in both M11 and M14, but I think I did.

What version are you using?

Stuart

Stuart,

I am using V14.

Mathcad 14.0 M020 (14.0.2.5 [802141434])

Thanks,

Mark
StuartBruff
23-Emerald II
(To:mgkoenig)

On 11/3/2009 9:56:32 AM, mgkoenig wrote:
== I am using V14.
== Mathcad 14.0 M020 (14.0.2.5 [802141434])

OK, I'm using the same version of M14 at home and have just checked the file again - I changed I1 to 11 deg and both scripted boxes turned red.

Do you have automatic calculation turned off? Try ctl-F9 - does that make any difference?

What security setting do you have (Tools/Preferences .. Script Security tab)?

If it's set to High or (if it's Medium and you don't allow the script to run) then the text box won't work (neither will any other of the scripted components in other worksheets).

Stuart

Thanks Stuart - I must be doing something wrong becasue it is still not working. I attached your script in the file called PASS_FAIL.xmcd.

I should be able to chage the RESULT to = "FAIL" and the text box should turn red.

Thanks for your help. I'm not going to spend much more time, but it does bug me.

Also, if I type "End Sub" at the bottom of the script I get an error??

Mark Koenig
StuartBruff
23-Emerald II
(To:mgkoenig)

On 11/3/2009 4:29:47 PM, mgkoenig wrote:
Thanks Stuart - I must be doing something wrong becasue it is still not working. I attached your script in the file called PASS_FAIL.xmcd.

I should be able to chage the RESULT to = "FAIL" and the text box should turn red.

Thanks for your help. I'm not going to spend much more time, but it does bug me.

Also, if I type "End Sub" at the bottom of the script I get an error??


All of your text boxes were disabled, Matt. When I enabled them, they worked.

Change the variable 'Test' at the bottom of the attached worksheet to be "PASS". If the text box doesn't change to yellow, then right-click on the box and see if (last item) in the pop-up menu says 'Enable Evaluation' or 'Disable Evaluation'.

If it says 'Enable Evalution' then something is probably changing the security settings for Mathcad. Click 'Enable Evaluation' and it should work.

If it says 'Disable Evaluation' then try pressing ctl-F9. If that doesn't work, then you're out of my knowledge base, I'm afraid.

(Note: Case is important)

Stuart

Thank You Stuart. That works

Mark Koenig
ELSID
4-Participant
(To:StuartBruff)

Stuart,
How did you eliminate the "dummy" variable in your
scriptable text box? Also, I am having a problem with having to "Enable Evaluation" everytime I open a sheet. Security is set to medium.

Attached is your file with my script and example on the right (per the PTC website example). It works in Mathcad 14, saved in 11 of consistency
StuartBruff
23-Emerald II
(To:ELSID)

On 11/3/2009 7:08:47 PM, ElSid wrote:
== How did you eliminate the "dummy" variable in your scriptable text box?

Right-click in the box, select 'Remove Output Variable' from the pop-up menu.

== Also, I am having a problem with having to "Enable Evaluation" everytime I open a sheet. Security is set to medium.

Set Security to Low.

Stuart

>I tried the script and still could not get it to work<<br> ________________________

Why use a scripted component that does not work instead of the other suggestion, simpler and native c/w a message. No more a matter of choice when the client returns nasty comment. Rather a matter of making him happy for his $.

jmG

On 11/3/2009 11:30:51 AM, jmG wrote:
>I tried the script and still could not get it to work<<br> ________________________

== Why use a scripted component that does not work instead of the other suggestion, simpler and native c/w a message. No more a matter of choice when the client returns nasty comment. Rather a matter of making him happy for his $.

Have you tried your suggestion on the target worksheet, Jean?

Stuart

>Have you tried your suggestion on the target worksheet, Jean?<<br> ______________________

No Stuart, I didn't.

I take scripted component only from Richard when confirmed proven. I have only few of them from years still working well, especially the lovely calendar. My recollection told me it was not working form the first time it appeared (long time ago). I may have been wrong. One day, all these gadgets won't work anymore because of Microsoft. Sorry for the collab if he does not want to try my suggestion.
It might have to do with the stuff under the hood ?

Jean

Post the sheet. One cannot do much debugging from just a description.

What about units? You talk about degrees, but Mathcad normally keeps angles in radians. Are you adjusting the units prior to passing the data to the component?

Another possibility is to use an embedded Excel sheet for the output display. Then you can use Excel's formatting facilities, including conditional formatting. This can be particularly convenient if you have a number of related outputs to show.
__________________
� � � � Tom Gutman

Top Tags