If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

Blender BIM Addon - add Georeferencing to an imported IFC 4-Project not possible

Hello .

how can i add georeferencing to the attache dIFC-Model.
In Blender BIM addon i was not able to add a Georeferencing to the Project.
Someone an idea how i can do it or what the reason is that i can not add it?
In the simple example , create new IFC-Project and add then a georeferencing is possible in my installation.

thanks a lot and kind regards

stefstap

Comments

  • Hi @stefstap
    For reference to anyone reading, what happened is that pressing { Scene Properties -> IFC Geometry -> IFC Georeferencing -> Add Georeferencing } had no effect.
    I've done my best tracking the code and found that that behavior is due to this line of ifcopenshell Python API.

    It appears that according to the official designation, the ContextType attribute of an IfcGeometricRepresentationContext must be non-empty ("Model" in this case for the World Coordinate System of the IfcProject), whereas in your file it's empty. Quoted from the provided link:

    NOTE The inherited attribute ContextType shall have one of the following recognized values: 'Model', 'Plan', 'NotDefined'.

    So, changing the tenth line of your IFC file in a text editor from:
    #2= IFCGEOMETRICREPRESENTATIONCONTEXT($,$,3,0.010000000000000,#37,$);
    To:
    #2= IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,0.010000000000000,#37,$);

    Just amended your IFC file and made the Add Georeferencing button work as expected ?

    I guess it's your software vendor's fault... However, I agree that from BlenderBIM side, maybe a message to the user such as "A valid geometric representation context was not found within the IFC file" would provide a better experience for when handling invalid IFC files. @Moult any thoughts on this? Am I missing anything?

    theoryshaw
  • Hi @cvillagrasa . Thanks a lot for this fast answer. I have forwarded your Answer to our Software vendor and they have changed it and i have already the new build of our Vendor-software available.

    For your Information : We in Schindler are using a CAd-Software from Software Vendor DigiPara and using this for the automated creation of Drawing and 3D and outputs based on our configurator ... like the mentioned IFC. @Moult

    Stefstap

    theoryshawcvillagrasavpajic
  • Wow @stefstap that's been a fast response from DigiPara, then! ????
    Also, if you haven't already, you may want to take a look at the georeferencing documentation from BlenderBIM.

    vpajic
  • how can i add georeferencing to the attache dIFC-Model.

    I don't know if it's relevant to the thread, maybe a bit.
    But I have seen @vpajic posted this on LinkedIn about georeferencing

    Added the PDF for people who don't have LinkedIN.

    vpajic
  • Awesome! I'm thrilled to hear of such a quick fix from a vendor. These are rare :) I am generally against writing code to handle invalid IFCs - if the IFC is invalid, it is not our responsibility to accommodate people's mistakes (unless those people are very ... uh, prominent unfortunately).

    vpajic
  • Sure! I'm not advocating at all for an IFC universal repair kit inside BlenderBIM. The thing is that now there are these three situations with respect to the add georeferencing button:
    1. Fresh IfcProject (works good ??)
    2. Imported project with invalid geometric representation context (button does nothing and provides no feedback ?)
    3. Imported project with valid geometric representation context (works good ??)

    So a user assuming their IFC is good and trying back and forth between 1 and 2 may think BlenderBIM is broken and 3 is unreachable... and that's not great. I believe it would be a good thing to provide some informative feedback, just for the user to know that the door to be knocked is the vendor's. Maybe just a Blender INFO report with "Invalid IFC".

    Also, I get that it's not so easy due to the agnostic design of ifcopenshell-python. Running ifcopenshell.api.run("georeference.add_georeferencing") as it is now, will return None in all three cases... I'd say a pythonic way to solve it is to raise an exception for case 2 and then handle it in BB by showing the report, but of course that's a slight paradigm shift which would also be needed in the rest of ifcopenshell-python, and I can imagine your thoughts on this ?

  • Yeah it is a known fault of the API design that a robust pattern for errors / exceptions was not established. It would be awesome for this to improve, though it's not the most glamorous of coding :) PRs welcome!

  • Good! Maybe I can tackle this on September. Kind of related: is there a reason to call api.run with strings? Why not just something more like ???

    import ifcopenshell.api as ifc
    ifc.run.georeference.add()
    
  • What you've shown is using "run" as a namespace, which doesn't make much sense compared to ifc.georeference.add().

    The concept of using a run() function is to allow 1) drop-in replacement for a separate client/server relationship, which has not been coded yet, but the intention is there, so it may or may not run functions locally, and 2) listeners and event subscriptions (see things like ifcopenshell.api.add_post_listener).

    cvillagrasa
Sign In or Register to comment.