Print at Dec 17, 2025, 5:21:21 AM

Posted by Puybaret at Apr 17, 2023, 6:48:16 PM
Re: Build full JS version
Doesn't these options already exist as the import and export features in the page https://www.sweethome3d.com/fr/SweetHome3DOnlineManager.jsp for identified users?

If you want to remove the use of a server, reading a file from the local disk can be done with HomeRecorder.readHome method with a BlobURLContent built from a file chosen by the user with an <input type="file"> HTML element (you'll find examples in JSViewFactory.js).
But saving is another story! Even if I recently added the DirectHomeRecorder class to generate a Home.xml entry in a ZIP file, there's still no method to generate a SH3X file containing all the resources it needs (images and 3D models), like DefaultHomeOutputStream Java class (a SH3X file is like a SH3D file bu without the old Home serialized entry).
By the way, as far as I know, there's no function in JavaScript to write in a local file from a browser. You can write only in local storage or indexedDB.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator