SilentBob
SilentBob

Reputation: 3

Failure to write edited values into new IFC file in WIT using ExportFileAsIFC using the same code as in the IFC.js Crash Course

When I attempt to edit an IFCBUILDINGSTOREY name value and write a new IFC file in WIT using the ExportFileAsIFC code from the IFC.js Crash Course IFC editing section, I get an error: Line object cannot be serialized: Object { expressID: 138, type: 3124254112, GlobalId: {…}, OwnerHistory: {…}, Name: {…}, Description: null, ObjectType: {…}, ObjectPlacement: {…}, Representation: null, LongName: {…}, … } IFCWorker.js:87228:15. The value is definitely changed in the IFC data in the browser console output but it doesn't get written to the new IFC file. I cannot see any difference between my code and the course example code. The problem appears to be that the revised IFC data in the browser console output defines the storey as IFCBUILDINGSTOREY in the IFC.js course video but on my laptop the storey is defined as OBJECT in the browser console output. So I think it literally cannot serialize the non-specific OBJECT. I have posted the project on my GitHub at https://github.com/quarto-zz/WIT2 Please can anyone tell me what is different?

Upvotes: 0

Views: 204

Answers (2)

SilentBob
SilentBob

Reputation: 3

Solution found! In discussions with @ansoni on Discord at IFC.js the problem turned out to be two IFC library versions. The Crash Course videos show the library install commands for web-ifc and web-ifc-three as generic, which installs the latest version of each. The current versions of those two libraries cause a couple of issues, including the above problem. At this time, it is important to install the specific versions used in the Crash Course. npm i [email protected] [email protected] You can check which versions you have currently loaded in the package.json file. If you install the correct versions, be sure to replace the wasm and IfcWorker files locally, if you are already using them. This will solve the above ExportFileAsIFC issue and also a failure to load an IFC file into a WIV scene issue. The latest versions of these libraries that I had these issues with are: [email protected] and [email protected]

Upvotes: 0

Looks like a regression in [email protected]. We are looking into it. In the meantime, it should be solved by using the previous version by running the command: npm i [email protected] [email protected].

Upvotes: 0

Related Questions