ThatOpen / web-ifc-three

The official IFC Loader for Three.js.
https://ifcjs.github.io/info/
MIT License
521 stars 133 forks source link

WebIfcWorker.GetNameFromTypeCode always returns <web-ifc-type-unknown> #158

Open jespa007 opened 1 year ago

jespa007 commented 1 year ago

Hi,

Acording last the last code of web-ifc-three.js when it request GetNameFromTypeCode from IFC/web-workers/workers/WebIfcWorker.ts module, it passes data.args.modelID parameter as is shown in the following code,

export class WebIfcWorker implements WebIfcWorkerAPI {

    ...
    GetNameFromTypeCode(data: IfcEventData) {
               data.result=this.webIFC.GetNameFromTypeCode(data.args.modelID); // data.args.modelID --> undefined
               this.worker.post(data);
        }

    ...

}

The resulting value of data.args.modelID is undefined because acording last web-ifc implementation now the parameter passed is data.args.type. So the GetNameFromTypeCode body should be modified as it follows,

export class WebIfcWorker implements WebIfcWorkerAPI {
    ...

    GetNameFromTypeCode(data: IfcEventData) {
             data.result=this.webIFC.GetNameFromTypeCode(data.args.type);  // data.args.type -->  ok
             this.worker.post(data);
       }
    ...
}