Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi all,
I am needing to output calculated variables from my mathcad calculation sheet, into either a .txt or a .exp file. I have first tried using a matrix to do this, but the formatting is not exactly what I am needing.
I have attached my mathcad approach, and the resulting format. The problem with the format shown is the space between the =, and the value of the variable.
The reason I am needing to do this is so that I can output calculated variables into a file that will be read by siemens NX. Perhaps anyone knows of a script that has already been built that can do this? I found an example built by Mike Armstrong from a few years ago, but I could not get it to work with MathCad 15. It probably did not help that I have no experience writing scripts in MathCad.
Thanks guys.
-jw
Solved! Go to Solution.
I have attached my mathcad approach,
No, you seem to have forgotten to attach the sheet. You just had inserted a screenshot.
Justin Wollmann wrote:
Hi all,
I am needing to output calculated variables from my mathcad calculation sheet, into either a .txt or a .exp file. I have first tried using a matrix to do this, but the formatting is not exactly what I am needing.
I have attached my mathcad approach, and the resulting format. The problem with the format shown is the space between the =, and the value of the variable.
The reason I am needing to do this is so that I can output calculated variables into a file that will be read by siemens NX. Perhaps anyone knows of a script that has already been built that can do this?
Two methods come in mind at first.
1) You could use num2str() and concat() to turn the number into a string and concatenete it with the text in front, Then just output the vector consisting of those strings
2) similar as above but use WRITEBIN for more flexibility. You can get rid of the quotes here using str2vec as shown in this thread: http://communities.ptc.com/message/233148#233148
I have attached my mathcad approach,
No, you seem to have forgotten to attach the sheet. You just had inserted a screenshot.
Justin Wollmann wrote:
Hi all,
I am needing to output calculated variables from my mathcad calculation sheet, into either a .txt or a .exp file. I have first tried using a matrix to do this, but the formatting is not exactly what I am needing.
I have attached my mathcad approach, and the resulting format. The problem with the format shown is the space between the =, and the value of the variable.
The reason I am needing to do this is so that I can output calculated variables into a file that will be read by siemens NX. Perhaps anyone knows of a script that has already been built that can do this?
Two methods come in mind at first.
1) You could use num2str() and concat() to turn the number into a string and concatenete it with the text in front, Then just output the vector consisting of those strings
2) similar as above but use WRITEBIN for more flexibility. You can get rid of the quotes here using str2vec as shown in this thread: http://communities.ptc.com/message/233148#233148
JUST tried your first suggestion and it worked EXACTLY as I needed it. Formatting is perfect! Thank you.
-jw
Justin Wollmann wrote:
JUST tried your first suggestion and it worked EXACTLY as I needed it. Formatting is perfect! Thank you.
-jw
Fine - here is the second approach which in my opinion is more versatile compared to the inserted component.