Skip to content

Instantly share code, notes, and snippets.

View yiskang's full-sized avatar

Eason Kang yiskang

View GitHub Profile
@yiskang
yiskang / SensorHeatmapsExtension.js
Created March 5, 2024 01:42
APS DataViz Extensions Demo - Another way of creating heatmaps by using Revit Rooms, replacing public/extensions/SensorHeatmapsExtension.js
/// import * as Autodesk from "@types/forge-viewer";
import { UIBaseExtension } from './BaseExtension.js';
import { findNearestTimestampIndex } from './HistoricalDataView.js';
import { SensorHeatmapsPanel } from './SensorHeatmapsPanel.js';
export const SensorHeatmapsExtensionID = 'IoT.SensorHeatmaps';
export class SensorHeatmapsExtension extends UIBaseExtension {
constructor(viewer, options) {
super(viewer, options);
this.panel = undefined;
this._surfaceShadingData = undefined;
@yiskang
yiskang / RevitRooms.html
Last active April 1, 2024 08:37
Sample: Show Revit rooms from master view with a general Revit 3D view by model aggregation (Loading Multiple Models).
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no" />
<meta charset="utf-8">
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.88.*/style.min.css"
type="text/css">
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.88.*/viewer3D.min.js"></script>
@yiskang
yiskang / RevitProjectBasePointExtension.js
Created March 21, 2023 08:33
A APS Viewer extension for getting Revit Project Base Point position by AEC Model Data
/////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Forge Partner Development
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@yiskang
yiskang / DummyExportContext.cs
Created December 27, 2022 09:42
Dummy Revit Custom Exporter - This sample runs a dummy exporter to test if current Revit 3D view can be exported without any errors. It won't produce any files, just run the export API.
// (C) Copyright 2022 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software
// in object code form for any purpose and without fee is hereby
// granted, provided that the above copyright notice appears in
// all copies and that both that copyright notice and the limited
// warranty and restricted rights notice below appear in all
// supporting documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
@yiskang
yiskang / aec-dropme.html
Last active June 30, 2022 06:10
Demo of Forge Viewer's DropMe extension. Video: https://youtu.be/VNPnXb075Bc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.css"
type="text/css">
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.js"></script>
@yiskang
yiskang / DrawSectionBoxExt.js
Last active August 23, 2022 03:21
Forge Viewer: Demo how to get bounds of current section box and draw it on the screen
/////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Forge Partner Development
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@yiskang
yiskang / RoomLocatorExtension.js
Last active December 2, 2021 07:30
Find the room where a Forge Viewer object located. (Revit)
/////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Forge Partner Development
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@yiskang
yiskang / CustomPropertyPanel.js
Created August 8, 2021 13:55
Autodesk Forge Viewer CustomPropertyPanel for v7.x
/////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Forge Partner Development
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@yiskang
yiskang / separateHostOrLinkedElements.js
Created July 3, 2020 08:22
Forge Viewer function to separate host or linked elements in the composite Revit model
function getLeafNodes( model, dbIds ) {
return new Promise( ( resolve, reject ) => {
try {
const instanceTree = model.getData().instanceTree
dbIds = dbIds || instanceTree.getRootId();
@yiskang
yiskang / OSS-Download.html
Last active January 15, 2020 10:15
Demo how to download Forge OSS object with jQuery
<!DOCTYPE html>
<html>
<head>
<title>Forge OSS object download demo</title>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<!-- The Viewer CSS -->
<style>