@ifc-lite/cli 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/ask.d.ts +2 -0
- package/dist/commands/ask.d.ts.map +1 -0
- package/dist/commands/ask.js +403 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +115 -27
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +175 -11
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/info.js +24 -7
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/mutate.d.ts +2 -0
- package/dist/commands/mutate.d.ts.map +1 -0
- package/dist/commands/mutate.js +203 -0
- package/dist/commands/mutate.js.map +1 -0
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +548 -52
- package/dist/commands/query.js.map +1 -1
- package/dist/commands/stats.d.ts +2 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +269 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../src/commands/ask.ts"],"names":[],"mappings":"AAsTA,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuE9D"}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* ifc-lite ask <file.ifc> "<question>"
|
|
6
|
+
*
|
|
7
|
+
* Natural language recipe engine for BIM queries.
|
|
8
|
+
* Maps common questions to SDK operations via pattern matching.
|
|
9
|
+
*
|
|
10
|
+
* Examples:
|
|
11
|
+
* ifc-lite ask model.ifc "how many walls?"
|
|
12
|
+
* ifc-lite ask model.ifc "what is the window-wall ratio?"
|
|
13
|
+
* ifc-lite ask model.ifc "total floor area"
|
|
14
|
+
* ifc-lite ask model.ifc "list materials" --json
|
|
15
|
+
* ifc-lite ask model.ifc "tallest storey" --explain
|
|
16
|
+
*/
|
|
17
|
+
import { createHeadlessContext } from '../loader.js';
|
|
18
|
+
import { printJson, fatal, hasFlag } from '../output.js';
|
|
19
|
+
const RECIPES = [
|
|
20
|
+
// --- Counting recipes ---
|
|
21
|
+
{
|
|
22
|
+
name: 'count-walls',
|
|
23
|
+
patterns: [/how many walls/i, /wall count/i, /number of walls/i, /count.*walls/i],
|
|
24
|
+
description: 'Count all IfcWall entities',
|
|
25
|
+
execute: (bim) => {
|
|
26
|
+
const count = bim.query().byType('IfcWall').count();
|
|
27
|
+
return { answer: `${count} walls`, count, type: 'IfcWall' };
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'count-doors',
|
|
32
|
+
patterns: [/how many doors/i, /door count/i, /number of doors/i, /count.*doors/i],
|
|
33
|
+
description: 'Count all IfcDoor entities',
|
|
34
|
+
execute: (bim) => {
|
|
35
|
+
const count = bim.query().byType('IfcDoor').count();
|
|
36
|
+
return { answer: `${count} doors`, count, type: 'IfcDoor' };
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'count-windows',
|
|
41
|
+
patterns: [/how many windows/i, /window count/i, /number of windows/i, /count.*windows/i],
|
|
42
|
+
description: 'Count all IfcWindow entities',
|
|
43
|
+
execute: (bim) => {
|
|
44
|
+
const count = bim.query().byType('IfcWindow').count();
|
|
45
|
+
return { answer: `${count} windows`, count, type: 'IfcWindow' };
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'count-columns',
|
|
50
|
+
patterns: [/how many columns/i, /column count/i, /number of columns/i, /count.*columns/i],
|
|
51
|
+
description: 'Count all IfcColumn entities',
|
|
52
|
+
execute: (bim) => {
|
|
53
|
+
const count = bim.query().byType('IfcColumn').count();
|
|
54
|
+
return { answer: `${count} columns`, count, type: 'IfcColumn' };
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'count-slabs',
|
|
59
|
+
patterns: [/how many slabs/i, /slab count/i, /number of slabs/i, /count.*slabs/i, /how many floors/i],
|
|
60
|
+
description: 'Count all IfcSlab entities',
|
|
61
|
+
execute: (bim) => {
|
|
62
|
+
const count = bim.query().byType('IfcSlab').count();
|
|
63
|
+
return { answer: `${count} slabs`, count, type: 'IfcSlab' };
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'count-all',
|
|
68
|
+
patterns: [/how many elements/i, /total elements/i, /element count/i, /how many entities/i, /total entities/i],
|
|
69
|
+
description: 'Count all building elements',
|
|
70
|
+
execute: (bim) => {
|
|
71
|
+
const count = bim.query().count();
|
|
72
|
+
return { answer: `${count} total entities`, count };
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'count-type',
|
|
77
|
+
patterns: [/how many (ifc\w+)/i, /count (ifc\w+)/i],
|
|
78
|
+
description: 'Count entities of a specific IFC type',
|
|
79
|
+
execute: (bim, _store, match) => {
|
|
80
|
+
const typeName = match?.[1] ?? 'IfcProduct';
|
|
81
|
+
const count = bim.query().byType(typeName).count();
|
|
82
|
+
return { answer: `${count} ${typeName} entities`, count, type: typeName };
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
// --- Area & quantity recipes ---
|
|
86
|
+
{
|
|
87
|
+
name: 'total-wall-area',
|
|
88
|
+
patterns: [/total wall area/i, /wall area/i, /area of walls/i, /gross wall area/i],
|
|
89
|
+
description: 'Sum GrossSideArea for all walls',
|
|
90
|
+
execute: (bim) => {
|
|
91
|
+
const walls = bim.query().byType('IfcWall').toArray();
|
|
92
|
+
let total = 0;
|
|
93
|
+
for (const w of walls) {
|
|
94
|
+
total += getQuantity(bim, w.ref, ['GrossSideArea', 'NetSideArea']);
|
|
95
|
+
}
|
|
96
|
+
return { answer: `${round(total)} m2 total wall area`, value: round(total), unit: 'm2' };
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'total-floor-area',
|
|
101
|
+
patterns: [/total floor area/i, /floor area/i, /slab area/i, /gross floor area/i, /gfa/i],
|
|
102
|
+
description: 'Sum GrossArea for all slabs',
|
|
103
|
+
execute: (bim) => {
|
|
104
|
+
const slabs = bim.query().byType('IfcSlab').toArray();
|
|
105
|
+
let total = 0;
|
|
106
|
+
for (const s of slabs) {
|
|
107
|
+
total += getQuantity(bim, s.ref, ['GrossArea', 'NetArea']);
|
|
108
|
+
}
|
|
109
|
+
return { answer: `${round(total)} m2 total floor area`, value: round(total), unit: 'm2' };
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'window-wall-ratio',
|
|
114
|
+
patterns: [/window.?wall.?ratio/i, /wwr/i, /glazing ratio/i],
|
|
115
|
+
description: 'Calculate window-to-wall ratio',
|
|
116
|
+
execute: (bim) => {
|
|
117
|
+
const walls = bim.query().byType('IfcWall').toArray();
|
|
118
|
+
const windows = bim.query().byType('IfcWindow').toArray();
|
|
119
|
+
let wallArea = 0;
|
|
120
|
+
for (const w of walls)
|
|
121
|
+
wallArea += getQuantity(bim, w.ref, ['GrossSideArea', 'NetSideArea']);
|
|
122
|
+
let windowArea = 0;
|
|
123
|
+
for (const w of windows)
|
|
124
|
+
windowArea += getQuantity(bim, w.ref, ['Area']);
|
|
125
|
+
const ratio = wallArea > 0 ? (windowArea / wallArea) * 100 : 0;
|
|
126
|
+
return {
|
|
127
|
+
answer: `Window-Wall Ratio: ${round(ratio)}% (${round(windowArea)} m2 windows / ${round(wallArea)} m2 walls)`,
|
|
128
|
+
ratio: round(ratio),
|
|
129
|
+
windowArea: round(windowArea),
|
|
130
|
+
wallArea: round(wallArea),
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'total-volume',
|
|
136
|
+
patterns: [/total volume/i, /building volume/i, /volume of/i],
|
|
137
|
+
description: 'Sum volumes across all elements',
|
|
138
|
+
execute: (bim) => {
|
|
139
|
+
let total = 0;
|
|
140
|
+
for (const e of bim.query().toArray()) {
|
|
141
|
+
total += getQuantity(bim, e.ref, ['GrossVolume', 'NetVolume']);
|
|
142
|
+
}
|
|
143
|
+
return { answer: `${round(total)} m3 total volume`, value: round(total), unit: 'm3' };
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
// --- Listing recipes ---
|
|
147
|
+
{
|
|
148
|
+
name: 'list-storeys',
|
|
149
|
+
patterns: [/list.*storey/i, /what.*storey/i, /which.*storey/i, /show.*storey/i, /list.*floor/i, /what.*floor/i, /how many storey/i, /how many floor/i],
|
|
150
|
+
description: 'List all building storeys',
|
|
151
|
+
execute: (bim) => {
|
|
152
|
+
const storeys = bim.storeys();
|
|
153
|
+
const names = storeys.map((s) => s.name).filter(Boolean);
|
|
154
|
+
return {
|
|
155
|
+
answer: `${storeys.length} storeys: ${names.join(', ') || '(unnamed)'}`,
|
|
156
|
+
count: storeys.length,
|
|
157
|
+
storeys: names,
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'list-materials',
|
|
163
|
+
patterns: [/list.*material/i, /what.*material/i, /which.*material/i, /show.*material/i, /material.*list/i, /material.*takeoff/i, /material.*summary/i],
|
|
164
|
+
description: 'List all unique materials with element counts',
|
|
165
|
+
execute: (bim) => {
|
|
166
|
+
const counts = new Map();
|
|
167
|
+
for (const e of bim.query().toArray()) {
|
|
168
|
+
const mat = bim.materials(e.ref);
|
|
169
|
+
const name = mat?.materials?.[0] ?? mat?.name;
|
|
170
|
+
if (name)
|
|
171
|
+
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
172
|
+
}
|
|
173
|
+
const materials = [...counts.entries()]
|
|
174
|
+
.sort((a, b) => b[1] - a[1])
|
|
175
|
+
.map(([name, count]) => ({ name, count }));
|
|
176
|
+
const lines = materials.map(m => ` ${m.name}: ${m.count} elements`).join('\n');
|
|
177
|
+
return {
|
|
178
|
+
answer: `${materials.length} materials:\n${lines}`,
|
|
179
|
+
count: materials.length,
|
|
180
|
+
materials,
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'list-types',
|
|
186
|
+
patterns: [/list.*type/i, /what.*type/i, /which.*type/i, /element.*type/i, /type.*breakdown/i, /element.*breakdown/i],
|
|
187
|
+
description: 'List element types with counts',
|
|
188
|
+
execute: (bim) => {
|
|
189
|
+
const counts = new Map();
|
|
190
|
+
for (const e of bim.query().toArray()) {
|
|
191
|
+
if (e.type)
|
|
192
|
+
counts.set(e.type, (counts.get(e.type) ?? 0) + 1);
|
|
193
|
+
}
|
|
194
|
+
const types = [...counts.entries()]
|
|
195
|
+
.sort((a, b) => b[1] - a[1])
|
|
196
|
+
.map(([type, count]) => ({ type, count }));
|
|
197
|
+
const lines = types.map(t => ` ${t.type}: ${t.count}`).join('\n');
|
|
198
|
+
return {
|
|
199
|
+
answer: `${types.length} element types:\n${lines}`,
|
|
200
|
+
count: types.length,
|
|
201
|
+
types,
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'building-name',
|
|
207
|
+
patterns: [/building name/i, /what.*building/i, /project name/i, /model name/i],
|
|
208
|
+
description: 'Get the building name',
|
|
209
|
+
execute: (bim) => {
|
|
210
|
+
const buildings = bim.query().byType('IfcBuilding').toArray();
|
|
211
|
+
const name = buildings[0]?.name ?? '(unnamed)';
|
|
212
|
+
return { answer: `Building: ${name}`, name };
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: 'schema-version',
|
|
217
|
+
patterns: [/schema/i, /ifc version/i, /which version/i, /what version/i, /file format/i],
|
|
218
|
+
description: 'Get the IFC schema version',
|
|
219
|
+
execute: (_bim, store) => {
|
|
220
|
+
const schema = store.schemaVersion;
|
|
221
|
+
return { answer: `Schema: ${schema}`, schema };
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
// --- Spatial recipes ---
|
|
225
|
+
{
|
|
226
|
+
name: 'tallest-storey',
|
|
227
|
+
patterns: [/tallest.*storey/i, /highest.*storey/i, /tallest.*floor/i, /highest.*floor/i, /top.*storey/i, /top.*floor/i],
|
|
228
|
+
description: 'Find the storey with the most elements',
|
|
229
|
+
execute: (bim) => {
|
|
230
|
+
const storeys = bim.storeys();
|
|
231
|
+
let maxName = '(none)';
|
|
232
|
+
let maxCount = 0;
|
|
233
|
+
for (const s of storeys) {
|
|
234
|
+
const contained = bim.contains(s.ref);
|
|
235
|
+
if (contained.length > maxCount) {
|
|
236
|
+
maxCount = contained.length;
|
|
237
|
+
maxName = s.name ?? '(unnamed)';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return { answer: `Largest storey: ${maxName} with ${maxCount} elements`, storey: maxName, elementCount: maxCount };
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
// --- Validation recipes ---
|
|
244
|
+
{
|
|
245
|
+
name: 'duplicate-ids',
|
|
246
|
+
patterns: [/duplicate.*id/i, /duplicate.*global/i, /check.*id/i, /id.*duplicate/i, /validation/i, /health.*check/i],
|
|
247
|
+
description: 'Check for duplicate GlobalIds',
|
|
248
|
+
execute: (bim) => {
|
|
249
|
+
const entities = bim.query().toArray();
|
|
250
|
+
const ids = entities.map((e) => e.globalId).filter(Boolean);
|
|
251
|
+
const counts = new Map();
|
|
252
|
+
for (const id of ids)
|
|
253
|
+
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
254
|
+
const duplicates = [...counts.entries()].filter(([, c]) => c > 1);
|
|
255
|
+
if (duplicates.length === 0) {
|
|
256
|
+
return { answer: 'No duplicate GlobalIds found', duplicateCount: 0 };
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
answer: `${duplicates.length} duplicate GlobalIds found`,
|
|
260
|
+
duplicateCount: duplicates.length,
|
|
261
|
+
duplicates: duplicates.map(([id, count]) => ({ id, count })),
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
// --- Exterior wall recipe ---
|
|
266
|
+
{
|
|
267
|
+
name: 'exterior-walls',
|
|
268
|
+
patterns: [/exterior.*wall/i, /external.*wall/i, /outside.*wall/i, /facade.*area/i],
|
|
269
|
+
description: 'Count and measure exterior walls (IsExternal=true)',
|
|
270
|
+
execute: (bim) => {
|
|
271
|
+
const walls = bim.query().byType('IfcWall').toArray();
|
|
272
|
+
let count = 0;
|
|
273
|
+
let area = 0;
|
|
274
|
+
for (const w of walls) {
|
|
275
|
+
const isExt = getPropValue(bim, w.ref, 'Pset_WallCommon', 'IsExternal');
|
|
276
|
+
if (isExt === true || isExt === 'TRUE' || isExt === '.T.') {
|
|
277
|
+
count++;
|
|
278
|
+
area += getQuantity(bim, w.ref, ['GrossSideArea', 'NetSideArea']);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
answer: `${count} exterior walls, ${round(area)} m2 total area`,
|
|
283
|
+
count,
|
|
284
|
+
area: round(area),
|
|
285
|
+
};
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
];
|
|
289
|
+
// Dynamic count-type recipe with IFC type extraction from question
|
|
290
|
+
function findMatchingRecipe(question) {
|
|
291
|
+
for (const recipe of RECIPES) {
|
|
292
|
+
for (const pattern of recipe.patterns) {
|
|
293
|
+
const match = question.match(pattern);
|
|
294
|
+
if (match)
|
|
295
|
+
return { recipe, match };
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
export async function askCommand(args) {
|
|
301
|
+
const jsonOutput = hasFlag(args, '--json');
|
|
302
|
+
const explain = hasFlag(args, '--explain');
|
|
303
|
+
// Parse positional args (skip flags)
|
|
304
|
+
const positional = [];
|
|
305
|
+
for (const arg of args) {
|
|
306
|
+
if (arg.startsWith('-'))
|
|
307
|
+
continue;
|
|
308
|
+
positional.push(arg);
|
|
309
|
+
}
|
|
310
|
+
if (positional.length < 2) {
|
|
311
|
+
fatal('Usage: ifc-lite ask <file.ifc> "<question>" [--json] [--explain]\n\nExamples:\n ifc-lite ask model.ifc "how many walls?"\n ifc-lite ask model.ifc "window-wall ratio"\n ifc-lite ask model.ifc "list materials" --json\n ifc-lite ask model.ifc "total floor area" --explain\n\nUse --explain to see which recipe was matched.');
|
|
312
|
+
}
|
|
313
|
+
const [filePath, ...questionParts] = positional;
|
|
314
|
+
const question = questionParts.join(' ');
|
|
315
|
+
const found = findMatchingRecipe(question);
|
|
316
|
+
if (!found) {
|
|
317
|
+
if (jsonOutput) {
|
|
318
|
+
printJson({ error: 'No matching recipe', question, availableRecipes: RECIPES.map(r => r.name) });
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
process.stderr.write(`No recipe matched: "${question}"\n\n`);
|
|
322
|
+
process.stderr.write('Available topics:\n');
|
|
323
|
+
const grouped = new Map();
|
|
324
|
+
for (const r of RECIPES) {
|
|
325
|
+
const category = r.name.split('-')[0];
|
|
326
|
+
const list = grouped.get(category) ?? [];
|
|
327
|
+
list.push(` ${r.name}: ${r.description}`);
|
|
328
|
+
grouped.set(category, list);
|
|
329
|
+
}
|
|
330
|
+
for (const [, items] of grouped) {
|
|
331
|
+
for (const item of items) {
|
|
332
|
+
process.stderr.write(item + '\n');
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
process.stderr.write('\nTip: Try phrasing your question differently, or use "ifc-lite ask <file> --explain" to debug matching.\n');
|
|
336
|
+
}
|
|
337
|
+
process.exit(1);
|
|
338
|
+
}
|
|
339
|
+
const { recipe, match } = found;
|
|
340
|
+
const { bim, store } = await createHeadlessContext(filePath);
|
|
341
|
+
if (explain) {
|
|
342
|
+
process.stderr.write(`Recipe: ${recipe.name}\n`);
|
|
343
|
+
process.stderr.write(`Description: ${recipe.description}\n`);
|
|
344
|
+
process.stderr.write(`Pattern matched: ${match?.[0] ?? question}\n\n`);
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
const result = recipe.execute(bim, store, match);
|
|
348
|
+
if (jsonOutput) {
|
|
349
|
+
printJson({
|
|
350
|
+
recipe: recipe.name,
|
|
351
|
+
question,
|
|
352
|
+
...result,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
process.stdout.write(result.answer + '\n');
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
catch (err) {
|
|
360
|
+
if (jsonOutput) {
|
|
361
|
+
printJson({ error: err.message, recipe: recipe.name, question });
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
fatal(`Recipe "${recipe.name}" failed: ${err.message}`);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
function getQuantity(bim, ref, names) {
|
|
369
|
+
try {
|
|
370
|
+
const qsets = bim.quantities(ref);
|
|
371
|
+
for (const qset of qsets) {
|
|
372
|
+
for (const q of qset.quantities) {
|
|
373
|
+
if (names.includes(q.name)) {
|
|
374
|
+
return Number(q.value) || 0;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
catch {
|
|
380
|
+
// No quantities available
|
|
381
|
+
}
|
|
382
|
+
return 0;
|
|
383
|
+
}
|
|
384
|
+
function getPropValue(bim, ref, psetName, propName) {
|
|
385
|
+
try {
|
|
386
|
+
const psets = bim.properties(ref);
|
|
387
|
+
for (const pset of psets) {
|
|
388
|
+
if (pset.name === psetName) {
|
|
389
|
+
const prop = pset.properties?.find((p) => p.name === propName);
|
|
390
|
+
if (prop)
|
|
391
|
+
return prop.value;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
catch {
|
|
396
|
+
// Property not available
|
|
397
|
+
}
|
|
398
|
+
return undefined;
|
|
399
|
+
}
|
|
400
|
+
function round(n) {
|
|
401
|
+
return Math.round(n * 100) / 100;
|
|
402
|
+
}
|
|
403
|
+
//# sourceMappingURL=ask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/commands/ask.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AASzD,MAAM,OAAO,GAAa;IACxB,2BAA2B;IAC3B;QACE,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,CAAC,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,CAAC;QACjF,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpD,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9D,CAAC;KACF;IACD;QACE,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,CAAC,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,CAAC;QACjF,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAA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AACX,CAAC;AAED,SAAS,YAAY,CAAC,GAAQ,EAAE,GAAQ,EAAE,QAAgB,EAAE,QAAgB;IAC1E,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;gBACpE,IAAI,IAAI;oBAAE,OAAO,IAAI,CAAC,KAAK,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,yBAAyB;IAC3B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../src/commands/eval.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../src/commands/eval.ts"],"names":[],"mappings":"AAyBA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqG/D"}
|
package/dist/commands/eval.js
CHANGED
|
@@ -7,37 +7,135 @@
|
|
|
7
7
|
* Evaluate a JavaScript expression against the BIM SDK.
|
|
8
8
|
* The `bim` object is available with the full SDK API.
|
|
9
9
|
*
|
|
10
|
+
* When --type is specified, the expression is evaluated per-entity with
|
|
11
|
+
* `ref` bound to each entity reference, enabling patterns like:
|
|
12
|
+
* ifc-lite eval model.ifc "bim.quantity(ref, 'GrossSideArea')" --type IfcWall --limit 3
|
|
13
|
+
*
|
|
10
14
|
* Examples:
|
|
11
15
|
* ifc-lite eval model.ifc "bim.query().byType('IfcWall').count()"
|
|
12
16
|
* ifc-lite eval model.ifc "bim.query().byType('IfcDoor').toArray().map(d => d.name)"
|
|
13
17
|
*/
|
|
14
18
|
import { createHeadlessContext } from '../loader.js';
|
|
15
|
-
import { printJson, fatal } from '../output.js';
|
|
19
|
+
import { printJson, fatal, hasFlag, getFlag } from '../output.js';
|
|
20
|
+
/** Known flags that take a value argument */
|
|
21
|
+
const EVAL_VALUE_FLAGS = new Set(['--type', '--limit']);
|
|
16
22
|
export async function evalCommand(args) {
|
|
17
|
-
const
|
|
23
|
+
const jsonOutput = hasFlag(args, '--json');
|
|
24
|
+
const typeFilter = getFlag(args, '--type');
|
|
25
|
+
const limitStr = getFlag(args, '--limit');
|
|
26
|
+
// Parse positional args, skipping known flags and their values.
|
|
27
|
+
// Once the file path (first positional) is collected, stop option parsing
|
|
28
|
+
// so expressions like "-1" are not treated as flags.
|
|
29
|
+
const positional = [];
|
|
30
|
+
let noMoreOptions = false;
|
|
31
|
+
for (let i = 0; i < args.length; i++) {
|
|
32
|
+
const arg = args[i];
|
|
33
|
+
if (arg === '--') {
|
|
34
|
+
noMoreOptions = true;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (!noMoreOptions) {
|
|
38
|
+
if (EVAL_VALUE_FLAGS.has(arg)) {
|
|
39
|
+
i++; // skip flag value
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (arg.startsWith('-'))
|
|
43
|
+
continue; // skip boolean flags
|
|
44
|
+
}
|
|
45
|
+
positional.push(arg);
|
|
46
|
+
// After collecting the file path, treat everything else as expression parts
|
|
47
|
+
if (positional.length === 1)
|
|
48
|
+
noMoreOptions = true;
|
|
49
|
+
}
|
|
18
50
|
if (positional.length < 2)
|
|
19
51
|
fatal('Usage: ifc-lite eval <file.ifc> "<expression>"');
|
|
20
52
|
const [filePath, ...exprParts] = positional;
|
|
21
53
|
const expression = exprParts.join(' ');
|
|
22
54
|
const { bim } = await createHeadlessContext(filePath);
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
// When --type is specified, iterate entities and evaluate per-entity with `ref` in scope
|
|
56
|
+
if (typeFilter) {
|
|
57
|
+
const types = typeFilter.split(',').map(t => {
|
|
58
|
+
const trimmed = t.trim();
|
|
59
|
+
if (trimmed.startsWith('Ifc') || trimmed.startsWith('IFC') || trimmed.startsWith('ifc'))
|
|
60
|
+
return trimmed;
|
|
61
|
+
return 'Ifc' + trimmed;
|
|
62
|
+
});
|
|
63
|
+
let entities = bim.query().byType(...types).toArray();
|
|
64
|
+
if (limitStr)
|
|
65
|
+
entities = entities.slice(0, parseInt(limitStr, 10));
|
|
66
|
+
const results = [];
|
|
67
|
+
const evalFn = buildEvalFunction(expression, ['bim', 'ref', 'entity']);
|
|
68
|
+
for (const entity of entities) {
|
|
69
|
+
try {
|
|
70
|
+
const result = evalFn(bim, entity.ref, entity);
|
|
71
|
+
const resolved = result instanceof Promise ? await result : result;
|
|
72
|
+
results.push({
|
|
73
|
+
Name: entity.name,
|
|
74
|
+
Type: entity.type,
|
|
75
|
+
GlobalId: entity.globalId,
|
|
76
|
+
result: resolved ?? null,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
results.push({
|
|
81
|
+
Name: entity.name,
|
|
82
|
+
Type: entity.type,
|
|
83
|
+
GlobalId: entity.globalId,
|
|
84
|
+
error: err.message,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (jsonOutput) {
|
|
89
|
+
printJson({ results });
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
for (const r of results) {
|
|
93
|
+
const val = r.error ? `ERROR: ${r.error}` : formatValue(r.result);
|
|
94
|
+
process.stdout.write(`${r.Name ?? r.GlobalId}: ${val}\n`);
|
|
95
|
+
}
|
|
96
|
+
process.stderr.write(`\n${results.length} entities evaluated\n`);
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Standard eval (no --type): evaluate expression once with bim in scope
|
|
101
|
+
const evalFn = buildEvalFunction(expression, ['bim']);
|
|
102
|
+
try {
|
|
103
|
+
const result = evalFn(bim);
|
|
104
|
+
// Handle async results
|
|
105
|
+
const resolved = result instanceof Promise ? await result : result;
|
|
106
|
+
if (jsonOutput) {
|
|
107
|
+
printJson({ result: resolved ?? null });
|
|
108
|
+
}
|
|
109
|
+
else if (resolved === undefined || resolved === null) {
|
|
110
|
+
process.stdout.write('null\n');
|
|
111
|
+
}
|
|
112
|
+
else if (typeof resolved === 'object') {
|
|
113
|
+
printJson(resolved);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
process.stdout.write(String(resolved) + '\n');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
fatal(`Evaluation error: ${err.message}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Build an eval function from an expression string.
|
|
125
|
+
* Handles both single expressions and multi-statement code.
|
|
126
|
+
*/
|
|
127
|
+
function buildEvalFunction(expression, paramNames) {
|
|
26
128
|
const isStatement = /^\s*(const |let |var |for |if |while |return |class |function |try |switch |{)/.test(expression)
|
|
27
129
|
|| expression.includes(';');
|
|
28
130
|
let body;
|
|
29
131
|
if (isStatement) {
|
|
30
|
-
// For multi-statement code: if the last statement is an expression (not a declaration),
|
|
31
|
-
// auto-return it so users don't need to write explicit return
|
|
32
132
|
const statements = expression.split(';').map(s => s.trim()).filter(Boolean);
|
|
33
133
|
const last = statements[statements.length - 1];
|
|
34
134
|
const isLastDeclaration = /^(const |let |var |for |if |while |return |class |function |try |switch |{)/.test(last);
|
|
35
135
|
if (!isLastDeclaration && statements.length > 1) {
|
|
36
|
-
// Replace last statement with return
|
|
37
136
|
statements[statements.length - 1] = `return (${last})`;
|
|
38
137
|
}
|
|
39
138
|
else if (isLastDeclaration && /^(const |let |var )\s*(\w+)/.test(last)) {
|
|
40
|
-
// If last is a variable declaration, return the variable name
|
|
41
139
|
const varMatch = last.match(/^(?:const |let |var )\s*(\w+)/);
|
|
42
140
|
if (varMatch) {
|
|
43
141
|
statements.push(`return ${varMatch[1]}`);
|
|
@@ -48,26 +146,16 @@ export async function evalCommand(args) {
|
|
|
48
146
|
else {
|
|
49
147
|
body = `return (${expression})`;
|
|
50
148
|
}
|
|
51
|
-
|
|
149
|
+
return new Function(...paramNames, `
|
|
52
150
|
"use strict";
|
|
53
151
|
${body};
|
|
54
152
|
`);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
else if (typeof resolved === 'object') {
|
|
63
|
-
printJson(resolved);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
process.stdout.write(String(resolved) + '\n');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
fatal(`Evaluation error: ${err.message}`);
|
|
71
|
-
}
|
|
153
|
+
}
|
|
154
|
+
function formatValue(value) {
|
|
155
|
+
if (value === null || value === undefined)
|
|
156
|
+
return 'null';
|
|
157
|
+
if (typeof value === 'object')
|
|
158
|
+
return JSON.stringify(value);
|
|
159
|
+
return String(value);
|
|
72
160
|
}
|
|
73
161
|
//# sourceMappingURL=eval.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../../src/commands/eval.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D
|
|
1
|
+
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../../src/commands/eval.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAA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C/C,MAAM,iBAAiB,GAAG,6EAA6E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnH,IAAI,CAAC,iBAAiB,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChD,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,WAAW,IAAI,GAAG,CAAC;QACzD,CAAC;aAAM,IAAI,iBAAiB,IAAI,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACzE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAC7D,IAAI,QAAQ,EAAE,CAAC;gBACb,UAAU,CAAC,IAAI,CAAC,UAAU,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QACD,IAAI,GAAG,yBAAyB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/D,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,WAAW,UAAU,GAAG,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,QAAQ,CAAC,GAAG,UAAU,EAAE;;MAE/B,IAAI;GACP,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"AAgIA,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+GjE"}
|