xBimTeam / XbimWindowsUI

The home of XbimXplorer and WPF components for your desktop BIM applications.
Other
255 stars 150 forks source link

Xbim.Presentation in wpf application #24

Closed Maxima078 closed 8 years ago

Maxima078 commented 8 years ago

Hi,

I'm looking for documentation or samples to help me during Xbim integration. I'd like to be able to open ifc file and display it as part of a simple wpf application.

Thanks,

Max.

kazmaier commented 8 years ago

If you grab the nuget package for the WindowsUI, it includes a sample project that demonstrates an IFC explorer.

Andy On Feb 17, 2016 3:07 AM, "Maxima078" notifications@github.com wrote:

Hi,

I'm looking for documentation or samples to help me during Xbim integration. I'd like to be able to open ifc file and display it as part of a simple wpf application.

Thanks,

Max.

— Reply to this email directly or view it on GitHub https://github.com/xBimTeam/XbimWindowsUI/issues/24.

Maxima078 commented 8 years ago

Thank you for your answer. I cannot see any sample included in the package folder and in my solution neither when the package is installed. Maybe you did'nt mean during installation but directly in source code ?

But I've found the control in XbimXplorer and I was able to load my ifc like this:

<xbimcontrol:DrawingControl3D Grid.Row="1" Model="{Binding xModel}" />

Where xModel is XbimModel initialized like this:

var xModeltemp = new XbimModel();
var _temporaryXbimFileName = Path.GetTempFileName();
xModeltemp.CreateFrom(ifcFilename, _temporaryXbimFileName, reportPDel, true);
var context = new Xbim3DModelContext(xModeltemp);
context.CreateContext(geomStorageType: XbimGeometryType.PolyhedronBinary, progDelegate: reportPDel, adjustWCS: false);

xModel = xModeltemp;

It would be nice to have a usercontrol version of XbimXplorer but I can propably make it myself. This framework is very usefull, do you know the next release date?

Thanks,

Max.

kazmaier commented 8 years ago

Correct. The nuget source package.

As you have surmised, DrawingControl3D is the xaml control for use in wpf. There are a couple more controls that you will see once you grab the source package and open the solution.

Andy On Feb 17, 2016 9:36 AM, "Maxima078" notifications@github.com wrote:

Thank you for your answer. I cannot see any sample included in the package folder and in my solution neither when the package is installed. Maybe you did'nt mean during installation but directly in source code ?

But I've found the control in XbimXplorer and I was able to load my ifc like this:

Where xModel is XbimModel initialized like this:

var xModeltemp = new XbimModel(); var _temporaryXbimFileName = Path.GetTempFileName(); xModeltemp.CreateFrom(ifcFilename, _temporaryXbimFileName, reportPDel, true); var context = new Xbim3DModelContext(xModeltemp); context.CreateContext(geomStorageType: XbimGeometryType.PolyhedronBinary, progDelegate: reportPDel, adjustWCS: false);

xModel = xModeltemp;

It would be nice to have a usercontrol version of XbimXplorer but I can propably make it myself. This framework is very usefull, do you know the next release date?

Thanks,

Max.

— Reply to this email directly or view it on GitHub https://github.com/xBimTeam/XbimWindowsUI/issues/24#issuecomment-185287329 .

Maxima078 commented 8 years ago

Thank you. I'll check that. By the way I noticed a potential mistake here: https://github.com/xBimTeam/XbimWindowsUI/blob/master/Xbim.Presentation/Xbim3DViewerControl.xaml.cs#L50 The dependency property is not attached to the correct type (DrawingControl3D instead of Xbim3DViewerControl, 4 occurences)

Max.