Ifcopenshell: The reason why iterator.initialize() returns False

Created on 4 Nov 2020  路  5Comments  路  Source: IfcOpenShell/IfcOpenShell

Hi,
iterator.initialize() returns False for one of my files and I'm trying to find a reason why it happens. I've found https://github.com/IfcOpenShell/IfcOpenShell/issues/745 issue with a couple of things to try to find a cause. ifcopenshell.file.good() returned True for my file but ifcopenshell.get_log() returned [Error] Token $ at 2350979 invalid instance name.
So my first question is what 2350979 refers to? I assume it is a character in the file but would like to confirm. If my assumption is correct then the error log refers to the line
#62558= IFCPROPERTYSET('0XL5QKfdv1aeIaRUPyM8zD',#41,'Pset_QuantityTakeOff',$,(#46186));
I found something similar described in https://github.com/IfcOpenShell/IfcOpenShell/issues/430 but with FILE_NAME, not IFCPROPERTYSET.
Can you please advise if the error happened because IFCPROPERTYSET contains $?

Most helpful comment

2350979 is the byte offset of the token in the file where the error occurs.

In vim, you can access it by doing 2350979go to jump to the right location. At a glance, that property set looks alright, I think it's pointing elsewhere in your file.

All 5 comments

2350979 is the byte offset of the token in the file where the error occurs.

In vim, you can access it by doing 2350979go to jump to the right location. At a glance, that property set looks alright, I think it's pointing elsewhere in your file.

Thank you for the quick response. In vim 2350979go pointed me to the line
#61756= IFCOPENINGELEMENT('3pHVvFYdn5CQQBZEQTf2TR',#41,'Basic Wall:6" CONC:508927',$,'Opening',#61755,$,$);
To be precise #61755,$,$);

In this case, the opening element does not have any geometry representation associated with it. Though it is not illegal from the point of view of whether the attribute is required, it doesn't semantically make any sense, hence the error.

Maybe IfcOpenShell should skip over this opening, as I think it is technically legal? Ping @aothms

That's true @Moult that was also the intention, but there was a recent addition to check on Opening Representation Identifier for Reference, which didn't respect the fact that these attributes were optional

Thank you, that solved my issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harrycollin picture harrycollin  路  12Comments

yorikvanhavre picture yorikvanhavre  路  13Comments

Moult picture Moult  路  5Comments

Moult picture Moult  路  7Comments

globalcitizen picture globalcitizen  路  10Comments