Relative Content

Tag Archive for xbim

How can I change the opacity of models in DrawingControl of xbim windows ui using slider in wpf c#?

private void SetModelTransparency(double transparency) { foreach (var modelItem in DrawingControl.Viewport.Children.OfType<ModelVisual3D>()) { SetTransparency(modelItem.Content, transparency); } } private void SetTransparency(Model3D model, double transparency) { if (model is GeometryModel3D geometryModel) { var newMaterialGroup = new MaterialGroup(); ApplyTransparencyToMaterial(geometryModel.Material, transparency, newMaterialGroup); geometryModel.Material = newMaterialGroup; } else if (model is Model3DGroup modelGroup) { foreach (var child in modelGroup.Children) { SetTransparency(child, transparency); […]