|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Export HTML5 plug-in |
||
| Print at Dec 16, 2025, 9:19:54 AM |
|
|
| Posted by industria at Sep 22, 2016, 3:01:38 PM |
|
Export HTML5 plug-in How to click in a furniture (door, window etc) and open a Javascript alert contaign the CatalogID of the furniture clicked? |
| Posted by Puybaret at Sep 22, 2016, 4:04:27 PM |
|
Re: Export HTML5 plug-in You should call the method getClosestItemAt available in HomeComponent3D class in a listener added to the displayed canvas. If the returned object is an instance of HomePieceOfFurniture, then you may call its getCatalogId method to get its catalog ID and do whatever you want. The HomeComponent3D instance is returned by the getComponent3D method available on the object returned by viewHome function. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by boe666 at Nov 21, 2018, 6:04:34 PM |
|
Re: Export HTML5 plug-in Please check my code. Why It not working well ? Initialisation: And console has this after click on the furniture (i have only one): mouseup { target: canvas#viewerCanvas.viewerComponent , buttons: 0, clientX: 390, clientY: 233, layerX: 390, layerY: 233 } viewHome.html:114:8 mouse:390, 233 viewHome.html:118:8 null always is NULL! Can somebody explain why ? What do i wrong ? |
| Posted by boe666 at Nov 28, 2018, 8:32:53 AM |
|
Re: Export HTML5 plug-in Can anyone help ? |
| Posted by boe666 at Nov 28, 2018, 1:28:57 PM |
|
Re: Export HTML5 plug-in You should call the method getClosestItemAt available in HomeComponent3D class in a listener added to the displayed canvas. If the returned object is an instance of HomePieceOfFurniture, then you may call its getCatalogId method to get its catalog ID and do whatever you want. The HomeComponent3D instance is returned by the getComponent3D method available on the object returned by viewHome function. I tried to do it according this post but it is not working at all. I have access to Object'd list, to every variables and function, i studdy the JS API but i can't select any items my mouse, even set getHome().setSelectedItems(["number"]) do nothing (camera not move). I have set setAerialViewCenteredOnSelectionEnabled(true). Can somebody help me to understand what do I wrong ? |
| Posted by Puybaret at Nov 28, 2018, 6:42:55 PM |
|
Re: Export HTML5 plug-in It's difficult to say without a real example. Can't you share a sample page? ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by boe666 at Nov 29, 2018, 9:35:24 AM |
Re: Export HTML5 plug-in<html> |
| Posted by boe666 at Dec 3, 2018, 8:32:24 AM |
|
Re: Export HTML5 plug-in my real example is ok or somebody see there errors. What do I wrong ? |
| Posted by boe666 at Dec 3, 2018, 1:44:47 PM |
|
Re: Export HTML5 plug-in My changed code: var HPC = viewHome("viewerCanvas",I can select item by "finger" (in code), but still i can;t do it by mouse. Please help. |
| Posted by boe666 at Dec 5, 2018, 10:43:28 AM |
|
Re: Export HTML5 plug-in Can sombody Help ? I check the source. Method getClosestItemAt use the canvas3D.getClosestShapeAt. I don't know why it is't working - this object (HPC) has all furniture, selectable from code. |
|
|
|
Current timezone is GMT Dec 16, 2025, 9:19:54 AM |