MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / auditIfc

Function auditIfc

src/ifctester/webapp/src/modules/api/api.svelte.ts:166–186  ·  view source on GitHub ↗
(modelId: string, idsData: string | Uint8Array | ArrayBuffer)

Source from the content-addressed store, hash-verified

164}
165
166export async function auditIfc(modelId: string, idsData: string | Uint8Array | ArrayBuffer) {
167 try {
168 let idsBytes: Uint8Array;
169 if (typeof idsData === 'string') {
170 idsBytes = new TextEncoder().encode(idsData);
171 } else if (idsData instanceof ArrayBuffer) {
172 idsBytes = new Uint8Array(idsData);
173 } else {
174 idsBytes = idsData;
175 }
176
177 // Run audit
178 const auditResult = await wasm.auditIfc(modelId, idsBytes) as { json: AuditReportData; html: string };
179
180 console.log(`Audit completed for model ${modelId}`);
181 return auditResult;
182 } catch (error) {
183 console.error('Failed to audit IFC model:', error);
184 throw error;
185 }
186}
187
188export function getLoadedModels() {
189 return IFCModels.models;

Callers 1

runAuditFunction · 0.70

Calls 3

auditIfcMethod · 0.80
encodeMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected