-
Notifications
You must be signed in to change notification settings - Fork 1
/
index_testdwf.js
95 lines (75 loc) · 2.64 KB
/
index_testdwf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"use strict";
// global viewer
let viewer = null;
function createViewer(modelName, lightPreset) {
var options = {
'document': modelName,
'env': 'Local',
'keepCurrentModels': 'false'
};
var viewerElement = document.getElementById('viewer3D');
var viewer = new Autodesk.Viewing.GuiViewer3D(viewerElement, {});
//var viewer = new Autodesk.Viewing.Viewer3D(viewerElement, {});
Autodesk.Viewing.Initializer(options, function () {
viewer.initialize();
viewer.loadModel(options.document);
viewer.setLightPreset(lightPreset); // Typically, you can set the light preset here.
});
return viewer;
}
// tell the viewer to fit the geometry to the view extents.
function orient_view () {
if (viewer != null) {
var front = new THREE.Vector3(55, -75, 88); // THREE.Vector3 {x: -840.5865265814298, y: -863.2277424197167, z: 442.6790285404255}
viewer.navigation.setPosition(front);
viewer.fitToView (true) ;
viewer.createViewCube();
viewer.displayViewCube(true);
} else{
console.log("viewer is null");
}
}
let filename = "https://kevinvandecar.github.io/assets/dwf_test/AssemblySample.dwfx";
createViewer(filename,8);
/*var gcount = -1;
let filename ="";
function onClick() {
gcount += 1;
document.getElementById("clicks").innerHTML = gcount;
switch(gcount) {
case 0:
filename = "https://kevinvandecar.github.io/assets/dwf_test/FrontLoader.dwfx";
break;
case 1:
filename = "https://kevinvandecar.github.io/assets/dwf_test/HHA_I_ARC_POD_B2F-3F_v21(RevitToDWF).dwf";
break;
case 2:
filename = "https://kevinvandecar.github.io/assets/dwf_test/HHA_I_ARC_POD_B2F-3F_v21(VaultToDWF).dwf";
break;
case 3:
filename = "https://kevinvandecar.github.io/assets/dwf_test/HHA_I_ARC_POD_B2F-3F_v21withTexture(RevitToDWF).dwf";
break;
case 4:
filename = "https://kevinvandecar.github.io/assets/dwf_test/Project04E.rvt.dwf";
break;
case 5:
filename = "https://kevinvandecar.github.io/assets/dwf_test/rac_basic_sample_project(RevitToDWF1).dwf";
break;
case 6:
filename = "https://kevinvandecar.github.io/assets/dwf_test/rac_basic_sample_project(RevitToDWF2).dwf";
break;
case 7:
filename = "https://kevinvandecar.github.io/assets/dwf_test/rac_basic_sample_project_AllViewSheet(RevitViaVaultToDWF).dwf";
break;
case 8:
filename = "https://kevinvandecar.github.io/assets/dwf_test/rac_basic_sample_project_OnlySheet(VaultToDWF).rvt.dwf";
break;
case 9:
filename = "https://kevinvandecar.github.io/assets/dwf_test/AssemblySample.dwfx";
break;
default:
gcount = -1;
}
console.log(filename);
createViewer(filename,8);
};*/