XBIM - how to get rotation of an object (flowterminal)

71 views Asked by At

I am trying to get the rotation of an object (flowterminal) from a IFC-file using XBIM

enter image description here

i can not seem to find a property, so it seems that the rotation needs to be calculated

this is what i have so far:

        For Each flowTerminal As IIfcFlowTerminal In flowTerminals


            'insertionpoints
            Dim objectPlacement As IIfcLocalPlacement = flowTerminal.ObjectPlacement
            Dim relativeplacement As IIfcAxis2Placement3D = objectPlacement.RelativePlacement
            Dim location As IIfcCartesianPoint = relativeplacement.Location

            'rotatie van de inbouwdelen
            Dim localPlacement As IIfcLocalPlacement = DirectCast(flowTerminal.ObjectPlacement, IIfcLocalPlacement)

            ' Extract the transformation matrix from the local placement
            Dim transform As XbimMatrix3D = localPlacement.RelativePlacement.ToMatrix3D

            Dim Xdiff As Double = Math.Abs(transform.M11 - transform.M21)
            Dim Ydiff As Double = Math.Abs(transform.M12 - transform.M22)

            'Extract rotation angles from the transformation matrix
            Dim rollAngle As Double = Math.Atan2(Ydiff, Xdiff)

            'Convert angles to degrees
            rollAngle = rollAngle * (180.0 / Math.PI)
            MsgBox(rollAngle)



        Next
0

There are 0 answers