Skip to main content
Question

IFCSite local placement (Transformation matrix extraction)

  • July 10, 2019
  • 1 reply
  • 88 views

j_geo
Contributor
Forum|alt.badge.img+1

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!

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

virtualcitymatt
Celebrity
Forum|alt.badge.img+47

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","")