简体   繁体   中英

How to make a simple 3D Ifc Viewer in WPF with Xbim v2

I am trying to make a small 3d viewer in VS2019 - are there any tutorials on XBim I have searched and cant find anything, I have seen this post How to make a simple 3D Ifc Viewer in WPF with Xbim I need a turorial as I have put the refrences for xbim into my VS but how to add control to the wpf form and load my new house from a folder. I just need the link please Thank you for assisting

The easiest way is to reuse components from XbimWindowsUI project . All components are available as a nuget package . Once you add the package, you can follow the SO answer you link in the question .

For reference:

<xbim:DrawingControl3D
    Grid.Column="1"
    Grid.Row="1"
    x:Name="DrawingControl"
    SelectedEntity="{Binding Path=SelectedItem, ElementName=MainWindow, Mode=TwoWay}"
    Model="{Binding}"
    Focusable="True"
    MouseMove="DrawingControl_MouseMove">
    <xbim:DrawingControl3D.Background>
        <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
            <GradientStop Color="#D1CBC4" Offset="1"/>
            <GradientStop Color="#C8FCFF"/>
        </LinearGradientBrush>
    </xbim:DrawingControl3D.Background>
</xbim:DrawingControl3D>
IfcStore ifcModel = IfcStore.Open("ifcFile.ifc");

var context = new Xbim3DModelContext(ifcModel);
context.CreateContext();

DrawingControl.Model = ifcModel;
DrawingControl.LoadGeometry(ifcModel);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM