-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch-ifc-class.html
367 lines (336 loc) · 18.8 KB
/
search-ifc-class.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="assets/css/normalize.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/icofont.min.css">
<link rel="stylesheet" href="assets/css/animate.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<link rel="icon" type="image/png" href="assets/images/favicon-blender.png" />
<title>Search IFC class - find the correct IFC class to use in your BIM model</title>
</head>
<body class="home-page">
<!--=== Start Header Section ===-->
<header class="header-section">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<a class="navbar-brand" href="index.html">
<img src="assets/images/blender/blender-logo.png" alt="Logo">
</a>
<a href="javascript:void(0);" class="mobile-menu">
<div class="mobile-menu-btn">
<i class="icofont-lg icofont-navigation-menu"></i>
</div>
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a href="index.html" class="nav-link">home<span></span></a>
</li>
<li class="nav-item">
<a href="download.html" class="nav-link">download<span></span></a>
</li>
<li class="nav-item">
<a href="community.html" class="nav-link">community<span></span></a>
</li>
<li class="nav-item">
<a href="https://docs.bonsaibim.org" class="nav-link">documentation<span></span></a>
</li>
<li class="nav-item">
<a href="https://bonsaibim.org/search-ifc-class.html" class="nav-link">search ifc class<span></span></a>
</li>
</ul>
<div class="menu-right-options ms-auto">
<p>
<a href="https://opencollective.com/opensourcebim" target="_blank" title="Fund on Open Collective" class="fund">
<strong class="amount-raised" style="margin-right: 5px;">$</strong> / $5,000 funded
<span class="border-1">
<span class="progress-bar" id="progress-bar" data-status="0%" aria-label="Progress bar."></span>
</span>
</a>
</p>
<ul class="social-media-links">
<li>
<a href="https://twitter.com/BonsaiBIM" target="_blank" class="btn btn-primary">
<i class="icofont-twitter"></i>
</a>
</li>
<li class="github-icon">
<a href="https://github.com/ifcopenshell/ifcopenshell" target="_blank" class="">Github Icon</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</header>
<!--=== Start Menu Slide Bar ===-->
<aside class="menu-slide-bar">
<div class="close-mobile-menu">
<div class="mobile-logo">
<a href="index.html" class="mobile-logo">
<img src="assets/images/blender/blender-logo.png" alt="Logo">
</a>
</div>
<a href="javascript:void(0);" class="close-btn">
<i class="icofont-close-line"></i>
</a>
</div>
<nav class="side-mobile-menu">
<ul id="mobile-menu-active">
<li class="nav-item">
<a href="index.html" class="nav-link">home<span></span></a>
</li>
<li class="nav-item">
<a href="download.html" class="nav-link">download<span></span></a>
</li>
<li class="nav-item">
<a href="community.html" class="nav-link">community<span></span></a>
</li>
<li class="nav-item">
<a href="https://docs.bonsaibim.org" class="nav-link">documentation<span></span></a>
</li>
</ul>
</nav>
</aside>
<div class="body-overlay"></div>
<!--=== End Menu Slide Bar ===-->
<!--=== Start Banner Section ===-->
<section class="bg-color-fff1f2">
<div class="container community-header">
<div class="row">
<div class="col-lg-9">
<div class="banner-section">
<div class="side-border side-border-inner wow fadeInUp delay-0-4s"></div>
<div class="banner-content">
<h1 class="wow fadeInUp delay-0-2s"> Which IFC class should I use? </h1>
<h2 class="up-title wow fadeInUp delay-0-4s"> Find an IFC entity </h2>
</div>
</div>
<style>
ul ul {
list-style-type: none;
margin-bottom: 1rem;
}
.highlight {
background-color: #ffd043;
}
#search-query, #search-schema {
border-radius: 5px;
border: 1px solid #74c77b;
padding: 5px;
background-color: #fff;
height: 50px;
}
#search-query {
width: 20rem;
}
</style>
<section class="row">
<p>
Physical objects in an IFC file must be categorised to a <em>class</em>
of object, which has implications on what properties are expected to be
found on the object. For example, a wall has an IFC <em>class</em> of
<code>IfcWall</code>. If your BIM model has missing or incorrect
<em>class</em> categorisations, then your BIM model becomes difficult
to use for costing, sustainability quantification, automated
scheduling, filtering maintainable assets for facility management, and
more.
</p>
<p>
The <em>classes</em> available for you to use are different for
each IFC version. In general, more recent IFC versions have more classes.
This tool below lets you type what type of object you have, and
it will try and find the right IFC <em>class</em> for you.
</p>
<p>
<select class="u-full-width" type="text" id="search-schema">
<option value="IFC2X3">IFC2X3</option>
<option value="IFC4" selected>IFC4</option>
<option value="IFC4X3">IFC4X3</option>
</select>
<input class="u-full-width" type="text" id="search-query" placeholder="Search ... e.g. window / basin / gutter">
</p>
<div id="search-results"><p>Loading ...</p></div>
</section>
<script type="text/javascript">
function loadJSON(schema, callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', `assets/${schema}.json`, true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == '200') {
callback(xobj.responseText);
}
};
xobj.send(null);
}
function getResultsFromSchema(schema) {
var filteredResults = []
let keywords = query.value.trim().split(/\s+/);
keywords = keywords.map(keyword => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
keywords = keywords.filter(k => k.length > 0);
console.log(keywords);
for (let [name, data] of Object.entries(schema)) {
var totalResults = 0;
var cdata = structuredClone(data);
[totalMatches, name] = highlightMatches(name, keywords);
totalResults += totalMatches;
[totalMatches, cdata['description']] = highlightMatches(cdata['description'], keywords);
totalResults += totalMatches;
if ('predefined_types' in cdata) {
for (var [pt, pt_doc] of Object.entries(cdata['predefined_types'])) {
var [totalMatches, pt_doc] = highlightMatches(pt_doc, keywords);
cdata['predefined_types'][pt] = pt_doc;
totalResults += totalMatches;
var [totalMatches, newPt] = highlightMatches(pt, keywords);
if (newPt != pt) {
cdata['predefined_types'][newPt] = cdata['predefined_types'][pt];
delete cdata['predefined_types'][pt];
}
totalResults += totalMatches;
}
}
if (totalResults > 0) {
filteredResults.push([name, cdata])
}
}
return filteredResults;
}
function highlightMatches(text, keywords) {
if ( ! keywords) {
return [0, text];
}
const regex = new RegExp(`(${keywords.join('|')})`, 'gi');
let totalResults = 0;
const newText = text.replace(regex, (match) => {
totalResults++;
return `<span class="highlight">${match}</span>`;
});
return [totalResults, newText];
}
function appendLiFromResult(ul, item, liTemplate) {
var li = document.createElement('li');
li.innerHTML = liTemplate
.replace('_NAME_', item[0])
.replace('_SPEC_URL_', item[1]['spec_url'])
.replace('_DESCRIPTION_', item[1]['description']);
if ('predefined_types' in item[1]) {
_PT_TEMPLATE_ = '<ul>';
for (const [pt, pt_doc] of Object.entries(item[1]['predefined_types']).sort((a, b) => a[0].localeCompare(b[0]))) {
_PT_TEMPLATE_ += '<li><em><code>' + pt + '</code></em> - ' + pt_doc + '</li>';
}
_PT_TEMPLATE_ += '</ul>';
li.innerHTML = li.innerHTML.replace('_PT_TEMPLATE_', _PT_TEMPLATE_);
}
ul.appendChild(li);
}
function getResults(event) {
var filteredResults = getResultsFromSchema(document.schema);
var filteredAltResults = getResultsFromSchema(document.altSchema);
results.innerHTML = '<p>Query value: "<strong>' + query.value + '</strong>" - <strong>' + filteredResults.length + '</strong> result(s) found.</p>';
var ul = document.createElement('ul');
filteredResults.forEach(function(item) { appendLiFromResult(ul, item, liTemplate); });
filteredAltResults.forEach(function(item) { appendLiFromResult(ul, item, liAltTemplate); });
results.appendChild(ul);
}
var schema = document.getElementById('search-schema')
var query = document.getElementById('search-query')
var results = document.getElementById('search-results');
var liTemplate = '<strong><code>_NAME_</code></strong><br /><p>_DESCRIPTION_ - <a href="_SPEC_URL_">Read more</a></p><p>_PT_TEMPLATE_</p>';
var liAltTemplate = '<strong>Similar names to: <code>_NAME_</code></strong><br /><p>_DESCRIPTION_</p>';
function onFinishLoadJson(response) {
document.schema = JSON.parse(response);
document.altSchema = {
'Glazing / Glass / Pane': { 'description': 'If you are trying to classify a single pane of glass or glazing aggregated within a larger system, consider using an IfcPlate. Otherwise, if it is an entire window, use IfcWindow. If it is a glazed wall, consider IfcWall.', 'attributes': [] },
'Signage': { 'description': 'If you are trying to classify signage, please consider using IfcFurniture.', 'attributes': [] },
'Hob': { 'description': 'If you are trying to classify a hob on the ground, such as a concrete hob, please consider using an IfcSlab, unless the hob is of a construction method that detaches it from the slab.', 'attributes': [] },
'Flashing / Capping': { 'description': 'If you are trying to classify flashing, such as ridge flashing, or barge cappings, often used for waterproofing at junctions, please consider using an IfcCovering.', 'attributes': [] },
'Lighting rod': { 'description': 'If you are trying to classify a lighting rod, typically placed high up on a building, try an IfcCableSegment.', 'attributes': [] },
'Card or Fob Reader': { 'description': 'If you are trying to classify a card reader or fob reader to gain access to a door, try an IfcSensor with PredefinedType of IDENTIFIERSENSOR.', 'attributes': [] },
'Reed Switch': { 'description': 'Use IfcSwitchingDevice', 'attributes': [] },
'Electric strike': { 'description': 'This converts electrical to mechanical so use IfcActuator', 'attributes': [] },
'Electric isolating Switch': { 'description': 'This is also known as a disconnector, so use IfcSwitchingDevice with PredefinedType of SWITCHDISCONNECTOR', 'attributes': [] },
'VAV Box': { 'description': 'Look for IfcAirTerminalBox', 'attributes': [] },
'Fan Coil Unit (FCU)': { 'description': 'Look for IfcUnitaryEquipment', 'attributes': [] },
'Access Panel': { 'description': 'Use IfcDoor with a PredefinedType of TRAPDOOR', 'attributes': [] },
'Screed': { 'description': 'A screed is used in construction to create a level surface on a rough floor substrate. If a single element represents a composite floor structure that includes a screed layer, classify the whole element as IfcSlab with the PredefinedType: FLOOR. If the screed is a separate element from the floor structure, classify it as IfcCovering and use the PredefinedType: FLOORING when the screed is part of a composite floor covering that includes a finished surface or serves as a finished surface itself. If the screed is its own independent element, use the PredefinedType: TOPPING.', 'attributes': [] },
'Wallboard / Gypsum / Plasterboard / Sheeting / Lining': { 'description': 'A wallboard is a material used in construction to create a finished surface on walls and ceilings. For Walls: If a single element represents a composite wall structure that includes a wallboard layer, classify the whole element as IfcWall with the PredefinedType: ELEMENTED, PLUMBING, or PARTITION depending on its function. If the wallboard element is independent of a vertical structure, classify it as IfcCovering with the PredefinedType: CLADDING. For Ceilings: If a single element represents a composite floor/roof and ceiling structure that includes a wallboard layer, classify the whole element as IfcSlab with the PredefinedType: FLOOR or ROOF. If the wallboard element is independent of a horizontal floor/roof structure, classify it as IfcCovering with the PredefinedType: CEILING.', 'attributes': [] },
}
getResults();
}
loadJSON('IFC4', onFinishLoadJson);
query.addEventListener('change', getResults);
query.addEventListener('keyup', getResults);
schema.addEventListener('change', function(event) {
results.innerHTML = '<p>Loading ...</p>';
loadJSON(schema.value, onFinishLoadJson);
});
</script>
</div>
<!-- .col-ms-9 -->
<div class="col-lg-3 sidebar-section">
<h3 class="">Like this tool?</h3>
<p>
It's made with completely free software, by users just like yourself.
</p>
<div class="banner-content community-butn-section">
<div class="banner-btn">
<a href="https://ifcopenshell.org" class="main-btn wow fadeInUp delay-0-8s">
<span class="btn-style">
<i class="icofont-md icofont-code-alt"></i> Learn more
</span>
</a>
</div>
</div>
</div>
</div>
</section>
<!--=== End Banner Section ===-->
<div class="footer-section copy-wrap">
<div class="container">
<div>
<div class="back-to-top text-center">
<i class="icofont-simple-up"></i>
</div>
<div class="text-center">
<img src="assets/images/partner/partner-11.png" alt="Partner" class="" />
</div>
<div class="row">
<div class="col-lg-8">
<p class="footer-left-text">
Blender is Free Software made by the community of <a href="https://blender.org"><span>Blender.org</span></a>.
<br /><br />
Bonsai is built with ♥ on the <a href="https://ifcopenshell.org"><span>IfcOpenShell</span></a> project by amazing volunteers.
<br /><br />
You can <a href="community.html"><span> be one too! </span></a>
</p>
</div>
<div class="col-lg-4 text-right">
<img src="assets/images/footer-logo.png" alt="Footer Logo" class="footer-logo" />
<div class="pull-right">
<h5><a href="https://ifcopenshell.org">IfcOpenShell</a></h5>
<p>
The open source IFC toolkit <br> and geometry engine
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--=== End Footer Section ===-->
<!--=== JS Link ===-->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/owl.carousel.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/mobile-menu.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/main.js"></script>
<!-- jquery end -->
</body>
</html>