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
Asked
Active
Viewed 55 times
1 Answers
0
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);

Martin Cerny
- 344
- 3
- 9