Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Saving as java by default, rather than mph

Please login with a confirmed email address before reporting spam

Hello,

Does anyone know if there is a way to have COMSOL save the modelling currently opened in the GUI as a java file by default, rather than a mph file?

I have written a small script that reads my java everytime it changes and displays the differences with the previous saved version as a html page, but it's slowing me down to always go all the way to File > Save as ... > java


2 Replies Last Post 10 mai 2019, 18:54 UTC−4
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 10 mai 2019, 10:48 UTC−4

Hi Alexis,

Are you aware that you can compare the mph files directly? See the attached screenshot.

If you want a shortcut for saving as java, you can add a very short model method for that operation. It would only need a single instruction like

model.save("C:\tmp\myfile.java", "java");

Regards,
Henrik

-------------------
Henrik Sönnerlind
COMSOL
Hi Alexis, Are you aware that you can compare the mph files directly? See the attached screenshot. If you want a shortcut for saving as java, you can add a very short model method for that operation. It would only need a single instruction like model.save("C:\\tmp\\myfile.java", "java"); Regards, Henrik


Please login with a confirmed email address before reporting spam

Posted: 6 years ago 10 mai 2019, 18:54 UTC−4
Updated: 6 years ago 10 mai 2019, 18:54 UTC−4

Thanks for your reply!

Sadly I do not have access to model methods as a Linux user, which is frustrating because that would have matched my need exactly.

I never tried the direct comparison, I will give it a go!

Thanks for your reply! Sadly I do not have access to model methods as a Linux user, which is frustrating because that would have matched my need exactly. I never tried the direct comparison, I will give it a go!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.