Print at Dec 18, 2025, 7:53:56 PM

Posted by PacWood at Mar 13, 2018, 5:07:51 PM
Re: zoom for HTML5 tool file is weak compared to program zoom
Hello,

Thank you for your fast reply.

You are correct that I activated the Aerial view centered on selection option in Sweet Home 3D preferences panel
and selected an object in my buiding and was able to get closer.

As you suggested, I read omrico's thread.
In omrico's thread, there is the statement:
"The HomePreviewComponent returned by viewHome has access to UserPreferences."

I was hoping to do the following:

var HPC = viewHome(...);
var UP = HPC.getUserPreferences;
UP.setAerialViewCenteredOnSelectionEnabled(true);

But the browser states that the variable "UP" is undefined.

Below is the actual code used in the HTML.

<script>
var HPC = viewHome("viewerCanvas",
homeUrl,
onerror,
onprogression,
{roundsPerMinute: 0,
navigationPanel: "default",
levelsAndCamerasListId: "levelsAndCameras",
selectableLevels: ["Level 1", "Level 2"],
activateCameraSwitchKey: true
});


console.log(HPC);
var UP = HPC.getUserPreferences;
console.log(UP);
</script>


How do I get access to the UserPreferences so I can set the setAerialViewCenteredOnSelectionEnabled to true?
(and also to select an object)


thank you very much.