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

GetLine always returns the first LineID if its expressId not exist

Open jespa007 opened this issue 3 years ago • 4 comments

Hi there,

I found an issue at GetLine ( web-api-browser.js line 54518):

    GetLine(modelID, expressID, flatten = false) {
      let rawLineData = this.GetRawLineData(modelID, expressID); // <-- it always returns the first LineID when expressID not exist
      let lineData = FromRawLineData[rawLineData.type](rawLineData);
      if (flatten) {
        this.FlattenLine(modelID, lineData);
      }
      return lineData;
    }
 

GetLine returns always returns the first LineId when its expressID not exists . This case was happened when I tried to load an IFC that it had some missing relations (Is a not well exported IFC of course).

From my point of view I think that, the normal behaviour, it should be to throw an error or return undefined value.

Cheers and I'm very thankful to have this great piece of software in the community :-)

jespa007 avatar Oct 04 '22 09:10 jespa007

::take

aka-blackboots avatar Oct 15 '22 10:10 aka-blackboots

🟢🟢🟢

::take

Hi, @aka-blackboots! Thanks for taking this bounty! The due date is November 5, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

agviegas avatar Oct 15 '22 10:10 agviegas

::drop

aka-blackboots avatar Oct 15 '22 10:10 aka-blackboots

🟢🟢🟢

::drop

Hi, @aka-blackboots! Thanks for giving it a try! It’s now once again available for anyone to take.

agviegas avatar Oct 15 '22 10:10 agviegas

::take

BSchafer01 avatar Oct 27 '22 06:10 BSchafer01

🟢🟢🟢

::take

Hi, @BSchafer01! Thanks for taking this bounty! The due date is November 17, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

agviegas avatar Oct 27 '22 06:10 agviegas

::done

BSchafer01 avatar Nov 01 '22 16:11 BSchafer01

🟢🟢🟢

::done

Hi, @BSchafer01! Thanks for your contributions! Please submit an expense to IFC.js Open Collective. Then, tell us the invoice number via the ::expense::_____ command (replace the _____ with the invoice number).

agviegas avatar Nov 01 '22 16:11 agviegas

::expense::104189

BSchafer01 avatar Nov 02 '22 15:11 BSchafer01

🔴🔴🔴

::expense::104189

Hi, @BSchafer01! We cannot find a new expense with that invoice number. Please re-check the invoice number and re-send the command using the correct one.

agviegas avatar Nov 02 '22 15:11 agviegas

Hi @agviegas I've messed up the flow of the automation I believe. The expense has already been approved. I didn't use the "done" command until the expense was approved on Open Collective. Sorry about the confusion

BSchafer01 avatar Nov 02 '22 15:11 BSchafer01

It's ok!

agviegas avatar Nov 02 '22 21:11 agviegas