Пример #1
0
        /// <summary>
        /// Adds geometry to set of the first IfcRepresentationItems. If it does not exist it is created.
        /// </summary>
        /// <param name="Geometry">Xbim geometry to be added to the element.</param>
        public virtual void AddGeometrySweptSolid(IXbimGeometry Geometry)
        {
            IfcGeometricRepresentationItem ifcGeometry = Geometry.GetIfcGeometricRepresentation();

            if (Geometry == null)
            {
                Debug.WriteLine("XbimBuildingElement: No geometry to be set.");
                return;
            }
            IfcShapeRepresentation shape = _ifcBuildingElement.GetOrCreateSweptSolidShapeRepresentation(((IfcProject)_document.IfcModel().IfcProject).ModelContext());
            shape.Items.Add_Reversible(ifcGeometry);
        }
        /// <summary>
        /// Adds geometry to set of the first IfcRepresentationItems. If it does not exist it is created.
        /// </summary>
        /// <param name="Geometry">Xbim geometry to be added to the element.</param>
        public void AddGeometry(IXbimGeometry Geometry)
        {
            IfcGeometricRepresentationItem ifcGeometry = Geometry.GetIfcGeometricRepresentation();

            if (Geometry == null)
            {
                Debug.WriteLine("XbimBuildingElement: No geometry to be set.");
                return;
            }

            if (_spatialElement.GetFirstShapeRepresentation() == null)
            {
                _spatialElement.GetNewBrepShapeRepresentation(((IfcProject)_document.Model.IfcProject).ModelContext()).Items.Add_Reversible(ifcGeometry);
            }
            else
            {
                _spatialElement.GetFirstShapeRepresentation().Items.Add_Reversible(ifcGeometry);
            }
        }