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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Define a MathCAD document as a function

oguest
1-Newbie

Define a MathCAD document as a function

Hi,

I have a Mathcad document that calculates a single value based on two input values. In between, there are a handful of constants defined, some preliminary calculations, 2 solve blocks and a couple of simple equations at the end. Its working great, but I need to do this calculation over and over again with different input values.

I know you can define a solve block as a function, but is it possible to define an entire document as a function? If not, is there a way to bunch up a load of equations and 2 solve blocks into a single function?

Many thanks!

Oliver

5 REPLIES 5
oguest
1-Newbie
(To:oguest)

... oh and the input to the second solve block is the output from the first....

Can you use not Find but Root?

What you want is possible, but if you upload your worksheet it will be easier for us to show you how.

Alan.

StuartBruff
23-Emerald II
(To:oguest)

Oliver Guest wrote:

... is it possible to define an entire document as a function?...

The answer to this part of your question is "No". That capability is the subject of a Very-Long-Standing Feature Request.

Stuart

oguest
1-Newbie
(To:oguest)

Thanks for the feedback guys. I have found a solution / hack / workaround. Please see attached documents.

In OriginalDocument.mcdx, you will see the original work sheet that I am trying to make into a function.

In SubDocument.mcdx you will see the original document, but with the input values disables. This causes the document to throw a load of errors.... but...

In MasterDocument.mcdx you will see that I have defined the input values, called on the sub document and then output the results. I have done this multiple times with different inputs and results. (I guess you will have to relink to the document based on your file paths)

So it seems to be working nicely. The only thing I don't like is the errors in there. Is there a cleaner way to do it? I'm happy to keep it all in one document, if there is a way to bunch it all up into one function.

Thanks for the feedback!

Oliver

Top Tags