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 May 10, 2019, 6:54 p.m. EDT
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago May 10, 2019, 10:48 a.m. EDT

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: 5 years ago May 10, 2019, 6:54 p.m. EDT
Updated: 5 years ago May 10, 2019, 6:54 p.m. EDT

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.