engine_web-ifc icon indicating copy to clipboard operation
engine_web-ifc copied to clipboard

[Bug]: Generating new IFC Modell has no expressID

Open pcace opened this issue 6 months ago • 1 comments

What happened?

Hi there, i am not sure if this is a bug or because i am just starting with the web-ifc library. what i am trying to do is to create a simple ifc model from scratch.

this is how i start with it:

    const ifcApi = new IfcAPI()
    ifcApi.SetWasmPath('/web-ifc/')
    await ifcApi.Init()

    // Create IFC model (IFC4 Schema)
    const modelId = ifcApi.CreateModel({ schema: 'IFC4' })

    const axisPlacement = ifcApi.CreateIfcEntity(
      modelId,
      ifcApi.GetTypeCodeFromName('IFCAXIS2PLACEMENT3D'),
      [null, null, null],
    )
    ifcApi.WriteLine(modelId, axisPlacement)

    const geometricRepContext = ifcApi.CreateIfcEntity(
      modelId,
      ifcApi.GetTypeCodeFromName('IFCGEOMETRICREPRESENTATIONCONTEXT'),
      [null, 'Model', 3, 1.0e-5, axisPlacement.expressID, null],
    )
    ifcApi.WriteLine(modelId, geometricRepContext)


the issue i am having is, that i do not get over the last step in the example - i always get TypeError: Cannot read properties of null (reading 'expressID')

is there any reason why this would not be gerneated? or is there any example of how to create an ifc from scratch?

thanks a lot for help!

Version

"web-ifc": "^0.0.68",

What browsers are you seeing the problem on?

No response

Relevant log output

TypeError: Cannot read properties of null (reading 'expressID')

Anything else?

No response

pcace avatar Jun 03 '25 15:06 pcace

Can you print out the value of axisPlacement before and after the .writeLine and let me know what the output is

beachtom avatar Jul 09 '25 09:07 beachtom