private void CreateBoxShape(IFCImportShapeEditScope shapeEditScope, Transform scaledLcs) { using (IFCImportShapeEditScope.IFCContainingRepresentationSetter repSetter = new IFCImportShapeEditScope.IFCContainingRepresentationSetter(shapeEditScope, this)) { // Get the material and graphics style based in the "Box" sub-category of Generic Models. // We will create the sub-category if this is our first time trying to use it. // Note that all bounding boxes are controlled by a sub-category of Generic Models. We may revisit that decision later. // Note that we hard-wire the identifier to "Box" because older files may have bounding box items in an obsolete representation. SolidOptions solidOptions = null; Category bboxCategory = IFCCategoryUtil.GetSubCategoryForRepresentation(shapeEditScope.Document, Id, IFCRepresentationIdentifier.Box); if (bboxCategory != null) { ElementId materialId = (bboxCategory.Material == null) ? ElementId.InvalidElementId : bboxCategory.Material.Id; GraphicsStyle graphicsStyle = bboxCategory.GetGraphicsStyle(GraphicsStyleType.Projection); ElementId gstyleId = (graphicsStyle == null) ? ElementId.InvalidElementId : graphicsStyle.Id; solidOptions = new SolidOptions(materialId, gstyleId); } Solid bboxSolid = IFCGeometryUtil.CreateSolidFromBoundingBox(scaledLcs, BoundingBox, solidOptions); if (bboxSolid != null) { IFCSolidInfo bboxSolidInfo = IFCSolidInfo.Create(Id, bboxSolid); shapeEditScope.AddGeometry(bboxSolidInfo); } } return; }