Skip to content

Commit

Permalink
escape to deselect + properties in console
Browse files Browse the repository at this point in the history
  • Loading branch information
AnweshGangula committed May 5, 2022
1 parent 60ec293 commit 54961c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Basic source code for Web-IFC-Viewer

This projects is a hello world set-up for [web-ifc-viewer](https://ifcjs.github.io/info/docs/Guide/web-ifc-viewer/Introduction).
This project is a [hello world example](https://ifcjs.github.io/web-ifc-viewer/example/index) set-up for [web-ifc-viewer](https://ifcjs.github.io/info/docs/Guide/web-ifc-viewer/Introduction).

- web-ifc-viewer is a 3D BIM viewer with many tools and functionalities already implemented (section drawings, dimensions, etc.), allowing you to create BIM tools with very little effort.
- Also check-out [web-ifc-three](https://ifcjs.github.io/info/docs/Guide/web-ifc-three/Introduction) which is a boilerplate 3D BIM Viewer with no in-built functionalities. You can use this if you want to build your own custom application with full control over the implementation.
Expand Down
10 changes: 9 additions & 1 deletion bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -115892,8 +115892,13 @@ viewer.grid.setGrid();

const input = document.getElementById("file-input");

window.ondblclick = () => viewer.IFC.selector.pickIfcItem(true);
window.onmousemove = () => viewer.IFC.selector.prePickIfcItem();
// Select items and log properties
window.ondblclick = async () => {
const item = await viewer.IFC.selector.pickIfcItem(true);
if (item.modelID === undefined || item.id === undefined) return;
console.log(await viewer.IFC.getProperties(item.modelID, item.id, true));
};
viewer.clipper.active = true;

input.addEventListener("change",
Expand Down Expand Up @@ -115923,4 +115928,7 @@ window.onkeydown = (event) => {
else if (event.code === 'KeyO') {
viewer.clipper.deletePlane();
}
else if (event.code === 'Escape') {
viewer.IFC.selector.unpickIfcItems();
}
};
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ viewer.grid.setGrid();

const input = document.getElementById("file-input");

window.ondblclick = () => viewer.IFC.selector.pickIfcItem(true);
window.onmousemove = () => viewer.IFC.selector.prePickIfcItem();
// Select items and log properties
window.ondblclick = async () => {
const item = await viewer.IFC.selector.pickIfcItem(true);
if (item.modelID === undefined || item.id === undefined) return;
console.log(await viewer.IFC.getProperties(item.modelID, item.id, true));
}
viewer.clipper.active = true;

input.addEventListener("change",
Expand Down Expand Up @@ -39,4 +44,7 @@ window.onkeydown = (event) => {
else if (event.code === 'KeyO') {
viewer.clipper.deletePlane();
}
else if (event.code === 'Escape') {
viewer.IFC.selector.unpickIfcItems();
}
}

0 comments on commit 54961c7

Please sign in to comment.