-
Notifications
You must be signed in to change notification settings - Fork 87
/
import.html
174 lines (168 loc) · 9.19 KB
/
import.html
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<div class="import">
<div class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Import demo data</h3>
</div>
<div class="modal-body">
<p>
This process will create a new Main project called "Schependomlaan". Several files will be downloaded from <a href="https://github.com/buildingSMART/Sample-Test-Files/tree/master/IFC%202x3/Schependomlaan">The Schependomlaan project page</a> to your server.
</p>
<p>
This could take up to 60 minutes to complete. Make sure your server machine has at least 4GB assigned to BIMserver.
</p>
<div class="message ih">
</div>
<div class="progress ih">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span class="sr-only"></span>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-default" data-dismiss="modal">Close</a>
<a class="btn startBtn btn-primary">Start</a>
</div>
</div>
</div>
</div>
</div>
<script>
function Import(cd, main) {
var o = this;
o.structure = {
"Schependomlaan": {
"Architecture": "Design model IFC/IFC Schependomlaan.ifc",
"Construction": "Coordination model and subcontractors models/BIMsight Projectdata1/V_L_Constructief.ifc",
"Engineering": {
"concrete floors": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-breedplaatvloeren.ifczip",
"load bearing facade": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-lateien_en_geveldragers.ifczip",
"prefab stairs": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-prefab_trappen.ifczip",
"steel": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-staal.ifczip",
"hollow core": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-kanaalplaatvloer.ifczip",
"prefab balconies": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-prefab_balkons.ifczip",
"roof": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-kapconstructie_dakkapellen_platdak.ifczip",
"vebo": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-Vebo.ifczip",
"limestone": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-kalkzandsteen.ifczip",
"prefab floors": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-prefab_vloer_lifttop.ifczip",
"stair railings": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-traphekken.ifczip",
"wooden windows": "Coordination model and subcontractors models/BIMsight Projectdata1/ROOT-houten kozijnen.ifczip"
},
"MEP": "Coordination model and subcontractors models/BIMsight Projectdata1/HB_Nutsvoorzieningen.ifc",
"Suppliers": {
"BERNTS": "Coordination model and subcontractors models/BIMsight Projectdata1/BERNTS-Staalconstructie.ifc",
"FEK": {
"balcony": "Coordination model and subcontractors models/BIMsight Projectdata1/FEK - Balkonhekken en borstweringsleuningen.IFC",
"french balcony": "Coordination model and subcontractors models/BIMsight Projectdata1/FEK - Franse balkonhekken en doorvalbeveiliging.IFC",
"other": "Coordination model and subcontractors models/BIMsight Projectdata1/BALKONHEKKEN 23-9-2015.IFC",
"stair railing": "Coordination model and subcontractors models/BIMsight Projectdata1/FEK - Traphekken.IFC"
},
"GEELEN": {
"1st floor": "Coordination model and subcontractors models/BIMsight Projectdata1/GEELEN-Breedplaat V1.ifc",
"2nd floor": "Coordination model and subcontractors models/BIMsight Projectdata1/GEELEN-Breedplaat V2.ifc",
"3rd floor": "Coordination model and subcontractors models/BIMsight Projectdata1/GEELEN-Breedplaat V3.ifc",
"roof": "Coordination model and subcontractors models/BIMsight Projectdata1/GEELEN-Dakvloer.ifc"
},
"JORDAHL": "Coordination model and subcontractors models/BIMsight Projectdata1/JORDAHL-Gevelderagers.ifc",
"LINDEN": "Coordination model and subcontractors models/BIMsight Projectdata1/LINDEN - Kozijnen.ifcZIP",
"MULTICOM": {
"balconies": "Coordination model and subcontractors models/BIMsight Projectdata1/MULTICOM-balkons.ifc",
"plint": "Coordination model and subcontractors models/BIMsight Projectdata1/MULTICOM-banden.ifc",
"stairs": "Coordination model and subcontractors models/BIMsight Projectdata1/MULTICOM-trappen+bordessen.ifc"
},
"WAARDO": "Coordination model and subcontractors models/BIMsight Projectdata1/WAARDO-Kanaalplaatvloer.ifc",
"WILLEMSEN": {
"highrise": "Coordination model and subcontractors models/BIMsight Projectdata1/WILLEMSEN-Hoogbouw.ifc",
"highrise tiles": "Coordination model and subcontractors models/BIMsight Projectdata1/WILLEMSEN-Hoogbouw dakpannen.ifc",
"lowrise": "Coordination model and subcontractors models/BIMsight Projectdata1/WILLEMSEN-Laagbouw.ifc",
"lowrise tiles": "Coordination model and subcontractors models/BIMsight Projectdata1/WILLEMSEN-laagbouw dakpannen.ifc"
},
"XELLA": {
"1st floor": "Coordination model and subcontractors models/BIMsight Projectdata1/XELLA-Begane grond.ifc",
"2nd floor": "Coordination model and subcontractors models/BIMsight Projectdata1/XELLA-1e verdieping.ifc",
"3rd floor": "Coordination model and subcontractors models/BIMsight Projectdata1/XELLA-2e verdieping.ifc",
"4th floor": "Coordination model and subcontractors models/BIMsight Projectdata1/XELLA-3e verdieping.ifc"
},
"YTONG": {
"general": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Algemeen.ifc",
"plot01": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 01.ifc",
"plot02": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 02.ifc",
"plot03": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 03.ifc",
"plot04": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 04.ifc",
"plot05": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 05.ifc",
"plot06": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 06.ifc",
"plot07": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 07.ifc",
"plot08": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 08.ifc",
"plot09": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 09.ifc",
"plot10": "Coordination model and subcontractors models/BIMsight Projectdata1/YTONG-Kavel 10.ifc"
}
}
}
};
function createProjects(structure, list, parent, promise) {
if (typeof structure == "object") {
for (var key in structure) {
if (parent == null) {
promise.inc();
(function(key){
Global.bimServerApi.call("ServiceInterface", "addProject", {projectName: key, schema: "ifc2x3tc1"}, function(project){
createProjects(structure[key], list, project, promise);
promise.dec();
});
})(key);
} else {
promise.inc();
(function(key){
Global.bimServerApi.call("ServiceInterface", "addProjectAsSubProject", {parentPoid: parent.oid, projectName: key, schema: "ifc2x3tc1"}, function(project){
createProjects(structure[key], list, project, promise);
promise.dec();
});
})(key);
}
}
} else {
promise.inc();
Global.bimServerApi.call("ServiceInterface", "getSuggestedDeserializerForExtension", {extension: "ifc", poid: parent.oid}, function(deserializer){
list.push({project: parent, file: structure, deserializer: deserializer});
promise.dec();
});
}
}
function checkin(list, index, item) {
cd.find(".message").html("Checking in: " + item.file.substring(item.file.lastIndexOf("/") + 1)).show();
cd.find(".progress .progress-bar").css("width", (100 * index / list.length) + "%");
Global.bimServerApi.call("ServiceInterface", "checkinFromUrlSync", {
poid: item.project.oid,
comment: "Demo Checkin",
deserializerOid: item.deserializer.oid,
fileName: item.file.substring(item.file.lastIndexOf("/") + 1),
url: "https://github.com/buildingSMART/Sample-Test-Files/raw/master/IFC%202x3/Schependomlaan/" + encodeURIComponent(item.file),
merge: false
}, function(){
index++;
if (index < list.length) {
checkin(list, index, list[index]);
} else {
cd.find(".message").html("Done, you can close this window").show();
$.cookie(main.user.oid + "importalert", false);
cd.find(".progress").hide();
}
});
}
cd.find(".startBtn").click(function(){
cd.find(".startBtn").hide();
var list = [];
cd.find(".message").html("Creating projects...").show();
var promise = new BimServerApiPromise()
createProjects(o.structure, list, null, promise);
promise.done(function(){
cd.find(".progress").show();
var index = 0;
var item = list[index];
checkin(list, index, item);
})
});
}
</script>