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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Translate the entire conversation x

Javascript calculation in MAthcad

JV_10467934
7-Bedrock

Javascript calculation in MAthcad

Hi,

 

I have created some scripts to change some inputs in Mathcad and read the Output fields but I am finding troubles as the file is not fully updated when I read the outputs. I am trying to calculate with Syncronize() but overwrite my inputs and I would like to save the file but I am not finding the way.

 

Thank you

ACCEPTED SOLUTION

Accepted Solutions

Mathcad Prime 8.0.

 

I have found a partial solucion that is overwrite the file.

 

worksheet.SaveAs(fileSystemObject.BuildPath(dirScript,"file.mcdx"))

 

I have to check in deep if all the outputs are right but at least the outputs looks better.

View solution in original post

3 REPLIES 3

Hi,

 

The close statement is a function associated with the worksheet variable.

From the help file

 

How to create a worksheet variable

var worksheet = mathcad.Open(fileSystemObject.BuildPath(dirScript,"test.mcdx"));

 

Close(SaveOption)—Closes the worksheet if it is open in PTC Mathcad Prime.
SaveOption
SpSaveChanges—Force to save changes, without prompting the user, before the worksheet is closed.
spPromptToSaveChanges—Prompt the user to save changes before the worksheet is closed.
spDiscardChanges—Discard all changes and close the worksheet.
The special behavior for a new and non-modified worksheet:
The worksheet is closed without prompting the user, even if saveOptionArg is set to spPromptToSaveChanges.
The worksheet is closed without prompting the user, even if saveOptionArg is set to spSaveChanges.

Please specify which version of Mathcad you are using.

Mathcad Prime 8.0.

 

I have found a partial solucion that is overwrite the file.

 

worksheet.SaveAs(fileSystemObject.BuildPath(dirScript,"file.mcdx"))

 

I have to check in deep if all the outputs are right but at least the outputs looks better.

Announcements


Top Tags