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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Include files

AE_10050416
4-Participant

Include files

Hi all

I am trying to include Mathcad files where I use a variable as a part of the file name. i.e. when I change the variable, the name of the included file changes. I want this for Mathcad 15 and Mathcad prime.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
-MFra-
21-Topaz II
(To:AE_10050416)

You could do as shown in the following image:answer to AE_10050416.jpg

answer to AE_10050416-1.jpganswer to AE_10050416-2.jpg

View solution in original post

11 REPLIES 11
LucMeekes
23-Emerald III
(To:AE_10050416)

 

It is not supported, not in Mathcad, not in Prime.

 

Success!
Luc

AE_10050416
4-Participant
(To:LucMeekes)

Thanks for your reply.

Can the include commands be a part of "if" statement where a file is included only if a condition is satisfied?

LucMeekes
23-Emerald III
(To:AE_10050416)

Neither, as far as I know.

 

Luc

StuartBruff
23-Emerald II
(To:VladimirN)

Vladimir,

 

Is it possible to create/modify an Include region via the API?

 

Stuart 

-MFra-
21-Topaz II
(To:AE_10050416)

You could do as shown in the following image:answer to AE_10050416.jpg

answer to AE_10050416-1.jpganswer to AE_10050416-2.jpg

StuartBruff
23-Emerald II
(To:-MFra-)

What was the reason you chose the nested if-otherwise structure instead of, say, a vector?

 

2021 10 01 D.png

 

Or, 

 

2021 10 01 E.png

 

2021 10 01 F.png

 

Stuart

-MFra-
21-Topaz II
(To:StuartBruff)

I made it in 2018 and I published it in this community some time ago. So I thought that a click was enough, in your file, however, "there is no click". In my worksheet, there is still another if-otherwise nested structure for the actual launch of the chosen function by clicking on the corresponding button. I like your solution, it simplifies many things, however, I think you will find problems with the launch of functions that present, in addition to the independent variable, also parameters in number varying from function to function. See the following image:

answer to AE_10050416-.jpg

LucMeekes
23-Emerald III
(To:-MFra-)

This can be done also simply with:

LucMeekes_2-1633111317339.png

Success!

Luc

LucMeekes
23-Emerald III
(To:-MFra-)

If you consistently use the return for each result, you don't need any otherwise. That is due to the fact that return makes the program stop there.

LucMeekes_1-1633110070879.png

 

But you can also put all strings in a single array, and return the element with the proper index:

LucMeekes_0-1633109900108.png

As Stuart has shown.

 

Success!
Luc

-MFra-
21-Topaz II
(To:LucMeekes)

My approach to the problem is as basic as possible. If I think about it better, maybe my memory of C ++ influenced me a lot.

Top Tags