1

I am trying to get the dimensions of the buildingelementproxy in VB.net

with rectangular form the dimensions are correct but when i have a circular object the values are off by approx. 10mm..... strange!

Sub Main1()

   ' Load the IFC file
   Dim ifcFilePath As String = "C:\IFC\2 sparingen.ifc"

   ' Initialiseer het model
   Using model As IfcStore = IfcStore.Open(ifcFilePath)
       ' Creëer de geometrie context
       Dim context As New Xbim3DModelContext(model)
       context.CreateContext()

       ' Zoek naar alle Ifc-objecten
       Dim buildingElmProxy = model.Instances.OfType(Of IIfcBuildingElementProxy)()

       '***************************
       ' Loop door elke buildingelementproxy
       '***************************
       For Each BEproxy In buildingElmProxy
           ' Haal de geometrie op
           Dim geom = context.ShapeInstances.Where(Function(si) si.IfcProductLabel = BEproxy.EntityLabel)

           ' Bepaal de bounding box
           Dim bbox As XbimRect3D = XbimRect3D.Empty
           For Each shape In geom
               bbox.Union(shape.BoundingBox)
           Next

           ' Bereken de afmetingen
           Dim width As Double = bbox.SizeX
           Dim height As Double = bbox.SizeY
           Dim depth As Double = bbox.SizeZ

           ' Druk de afmetingen af
           MsgBox($"BuildingElementProxy: {BEproxy.Name}")
           MsgBox($"Width: {width}, Height: {height}, Depth: {depth}")
           Console.WriteLine()

       Next

   End Using
End Sub

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.