Print at Dec 18, 2025, 5:25:12 PM

Posted by Puybaret at Aug 12, 2022, 2:11:29 PM
Re: Sweet Home 3D JS Online
I never posted the code you cited in your message, but maybe the following JavaScript code that I tried in the console to save current plan view in an image will be helpful:
plan = application.getHomeController(application.getHomes()[0]).getPlanController().getView();
canvas = document.createElement('canvas');
canvas.width = plan.getPreferredSize().width * 2;
canvas.height = plan.getPreferredSize().height * 2;
plan.paintComponent(new Graphics2D(canvas));
link = document.createElement("a");
link.setAttribute("href", canvas.toDataURL());
link.download = "test.png";
link.click();

PS: please create different threads for this kind of support requests. This thread is for general information about Sweet Home 3D JS Online.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator