ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
573 stars 170 forks source link

[Bug]: Some objects are not parsed #859

Closed perstromswe closed 1 week ago

perstromswe commented 3 weeks ago

What happened?

I needed ports (ifcdistrubtionport) and this was a special export option in the model software (magicad export in Revit). After this, I noticed objects where missing.

No errors. No crash. Just objects missing.

I did a test where I moved an object that were missing from the lower part of the IFC file higher up in the file. Then it worked. Not only were the objects back again, but other objects that were previously missing also reappeared. Really wierd.

I understand this is tricky to debug without a file. I can give it to you but not in public. Is there email or something to the maintainers where I can send link to a file?

Version

0.0.54

What browsers are you seeing the problem on?

No response

Relevant log output

for (let i = 1; i <= lineSize; i++) {
    try {
      const itemId = lines.get(i);
      if (itemId == null) {
        continue;
      }
      let row: IfcBaseEntity.IRootObject;
      try {
        row = client.GetLine(modelId, itemId);
      } catch (err) {
       console.log(err
        continue;
      }

      if (row.GlobalId.value === '290aexvHH2AP4ov$E8id$g') { 
       console.log(JSON.stringify(row, null, 2)); //This globalId is in the file. It's not logging out.
       }

Anything else?

No response

beachtom commented 2 weeks ago

Can you share a model or extract IFC lines from a model?

perstromswe commented 2 weeks ago

Yes. Is there anyway to share the file i private?

beachtom commented 2 weeks ago

You can email it to me at beachth@cardiff.ac.uk

perstromswe commented 1 week ago

Apparently I need approval from project. I'll get back to you soon.

Felipemore96 commented 1 week ago

Hello! If you can please also share the model to check what's the issue: fmoreiras@apogeaconsulting.com

perstromswe commented 1 week ago

@beachtom file shaered. You should have received an email.

@Felipemore96 thanks but I only have approval to share with Tom.

beachtom commented 1 week ago

Nothing recieved as yet? Did you attach it to the mail? Or send a one drive link.

beachtom commented 1 week ago

It just arrvied!

beachtom commented 1 week ago

So I ran this code - as was able to retrieve that GUID object - which is the last one in the file. Not sure if you are doing something different, but it seems to me everything is working

 f    let lines = ifcapi.GetAllLines(modelID);

    for (let i = 1; i <= lines.size(); i++) {
        console.log(lines.get(i))
        try {

          let row;
          try {
            row = ifcapi.GetLine(modelID, lines.get(i));
          } catch (err) {
           console.log(err)
            continue;
          }

          if (row!= undefined && row.GlobalId !== undefined && row.GlobalId.value === '2z1njFJpvETuIm2SDAKYVn') { 
           console.log(JSON.stringify(row, null, 2)); //This globalId is in the file. It's not logging out.
           }

        } catch (err) {
            console.log(err);
        }
    }