简体   繁体   English

如何使用 Xbim v2 在 WPF 中制作一个简单的 3D Ifc Viewer

[英]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.我正在尝试在 VS2019 中制作一个小型 3d 查看器 - 是否有关于 XBim 的任何教程我搜索过但找不到任何东西,我看过这篇文章如何使用 Xbim 在 WPF 中制作一个简单的 3D Ifc 查看器我需要一个 turorial 因为我有将 xbim 的引用放入我的 VS,但如何将控件添加到 wpf 表单并从文件夹加载我的新房子。 I just need the link please Thank you for assisting我只需要链接谢谢你的协助

The easiest way is to reuse components from XbimWindowsUI project .最简单的方法是重用XbimWindowsUI 项目中的组件。 All components are available as a nuget package .所有组件均以nuget package 的形式提供 Once you add the package, you can follow the SO answer you link in the question .添加 package 后,您可以按照问题中链接的 SO 答案进行操作。

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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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