Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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
... 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.
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
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