Question

IFCSite local placement (Transformation matrix extraction)

  • 10 July 2019
  • 1 reply
  • 15 views

Badge

I have an issue with the coordinate system of the IFC geometries.

I have to extract the reference point from IFC, that is referenced by in IFCSite.

The element is IFCLOCALPLACEMENT that references the IFCAXIS2PLACEMENT3D that references

IFCCARTESIANPOINT that has the coordinates which I need.

 

The problem in FME is, that these coordinates are used to define the transformation matrix for

all geometries, but I cannot access these coordinates directly.

The similar issue was discussed in:

https://knowledge.safe.com/questions/4813/extracting-transformation-matrix.html

But the solution is far from elegant

 

Is there any way to obtain the IFC reference point coordinates?

 

Thanks in advance for any help!

 


1 reply

Userlevel 4
Badge +26

If you've already played around with all the settings in the reader - you can try using the python API to extract the matrix directly from a feature (below is an example from a PythonCaller). Another option id to use the XML reader (or even a text line reader) to try and extract the reference point that way.

 

import fme
import fmeobjects
# Template Function interface:
# When using this function, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
def processFeature(feature):
    try:
        tMatrix = feature.getGeometry().getTransformationMatrix()
        print(tMatrix[0][0])
        A = tMatrix[0][0]
        B = tMatrix[0][1]
        C = tMatrix[0][2]
        D = tMatrix[0][3]
        E = tMatrix[1][0]
        F = tMatrix[1][1]
        G = tMatrix[1][2]
        H = tMatrix[1][3]
        I = tMatrix[2][0]
        J = tMatrix[2][1]
        K = tMatrix[2][2]
        L = tMatrix[2][3]
        tMatrix = str(tMatrix)
        feature.setAttribute("_tMatrix",tMatrix)
        feature.setAttribute("A",A)
        feature.setAttribute("B",B)
        feature.setAttribute("C",C)
        feature.setAttribute("D",D)
        feature.setAttribute("E",E)
        feature.setAttribute("F",F)
        feature.setAttribute("G",G)
        feature.setAttribute("H",H)
        feature.setAttribute("I",I)
        feature.setAttribute("J",J)
        feature.setAttribute("K",K)
        feature.setAttribute("L",L)
    except:
        feature.setAttribute("_tMatrix","")

 

Reply