Simon Qi
happy I’m happy

Area value retrieval - IfcOpeningElement

Dear Léon van Berlo,

Thank you very much for answering us the questions. We really appreciate your help in this regard and we are very eager to get the desired result.

I kindly request you to clarify us the following question pertaining to the same problem.

Attachments:
1. Please find the attached image of a Slab and an OpeningElement associated with that slab.
2. An image of the hierarchy from IfcOpeningElement to a IfcRectangleProfileDef is also attached (View from IfcBrowser view).





The proposed changes in the code which you have said computes the following.
• Identifies the slab for which opening element is associated and using the inheritance hierarchy from the slab and results us the slab area itself.
• We are interested in computing the area of OpeningElement and area of that Slab is presently not the point of interest.

Precise requirement: In the attachment "Opening to RectangleProfileDef", which is a IFC Browser View

ID# 82: Opening Element has reference to 80.
ID# 80: Product Definition Shape has reference to 79
ID#79: ShapeRepresenation has reference to 76
ID# 76: ExtrudedAreaSolid has reference to 73.
ID# 73: RectangleProfileDef (CircleProfileDef/ArbitraryProfileDef).

IfcRectangleProfileDef Object has the methods getXDim and getYDim.

Objective: Finding relationship from OpeningElement to RectangleProfileDef to get X and Y Dim and compute the area as 9.999 * 18 to 180

Presently: Starting from the Slab, we were able to get the interested OpeningElement. How do we use the BIM Source code IfcHierarchy to reach RectangleprofileDef objects from any OpeningElement?

Required:
1. Kindly give us the sequence of objects and methods to invoke and the relationship objects involved.
2. Kindly throw us some light on how to approach a problem of this classification generically to resolve the relationship(Rel Objects).

Thank you!
1 person has
this question
+1
Reply

  • Hi Simon,

    The relationship between objects in IFC is not standardized. There can be several ways the opening is related to the slab. It might even not be related directly....
    There is no generic way to get a sequence of objects to invoke the relationship. The best way to find the relation is to open the model in a viewer (for example www.ifcbrowser.com) and find the relationship.
    We have a 'generic sequence-finder' on our wish-list. We could pull that to a higher priority after our holiday.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • This reply was removed on 2011-08-22.
    see the change log
  • Simon Qi
    Hi Leon,

    Thank you for your help. I will send the file to you soon.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Simon Qi
    Hi Léon,

    I have mailed the file to you. Sorry for interrupting your holiday.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Simon,

    This approach does not look very generic to me because opening elements can use different ways to represent the geometry, of which some can be very difficult to use for surface calculation. I think I sent you an example a while a go that uses the semantic information in the model which already stores the area, so you won't have to compute it. Please let me know if I am mistaken.

    But as requested, here is some code to go from IfcOpeningElement to IfcRectangleProfileDef:



    IfcProductRepresentation representation = openingElement.getRepresentation();
    IfcProductDefinitionShape ifcProductDefinitionShape = (IfcProductDefinitionShape)representation;
    for (IfcRepresentation ifcRepresentation : ifcProductDefinitionShape.getRepresentations()) {
    if (ifcRepresentation instanceof IfcShapeRepresentation) {
    IfcShapeRepresentation ifcShapeRepresentation = (IfcShapeRepresentation)ifcRepresentation;
    for (IfcRepresentationItem item : ifcShapeRepresentation.getItems()) {
    if (item instanceof IfcExtrudedAreaSolid) {
    IfcExtrudedAreaSolid extrudedAreaSolid = (IfcExtrudedAreaSolid)item;
    IfcProfileDef sweptArea = extrudedAreaSolid.getSweptArea();
    if (sweptArea instanceof IfcRectangleProfileDef) {
    IfcRectangleProfileDef rectangleProfileDef = (IfcRectangleProfileDef)sweptArea;
    float area = rectangleProfileDef.getXDim() * rectangleProfileDef.getYDim();
    System.out.println("Area calculated from geometry: " + area);
    }
    }
    }
    }
    }

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Simon Qi
    Dear Ruben,

    Thank you for the code. It is very illuminating.

    The example that uses the semantic information in the model which already stores the area did get some results. But they are the net area value of the slab, not the area value of IfcOpeningElements. Therefore I am trying to compute it through the geometric dimensions.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated