Ejemplo n.º 1
0
 public IXbimSolid CreateSolid(IIfcExtrudedAreaSolid ifcSolid, ILogger logger)
 {
     using (new Tracer(LogHelper.CurrentFunctionName(), this._logger, ifcSolid))
     {
         return(_engine.CreateSolid(ifcSolid, logger));
     }
 }
Ejemplo n.º 2
0
        public IIfcElement CreateSlopedCylinder(
            ref List <IIfcProduct> elements,
            double height,
            double radius,
            double botX,
            double botY,
            double topX,
            double topY,
            Guid guid)
        {
            double                     num1                   = Math.Max(radius * Math.Tan(Math.Abs(botX * Math.PI / 180.0)), radius * Math.Tan(Math.Abs(botY * Math.PI / 180.0)));
            double                     num2                   = Math.Max(radius * Math.Tan(Math.Abs(topX * Math.PI / 180.0)), radius * Math.Tan(Math.Abs(topY * Math.PI / 180.0)));
            IfcAxis2Placement          beamLocation           = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirY));
            IIfcAxis2Placement2D       axis2Placement2D       = IfcTools.CreateAxis2Placement2D(IfcTools.CreatePoint(0.0, 0.0), IfcTools.CreateDirection(1.0, 0.0));
            IIfcAxis2Placement3D       axis2Placement3D       = IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(0.0, 0.0, -height / 2.0 - num1), IfcTools.CreateDirection(0.0, 0.0, 1.0), IfcTools.CreateDirection(1.0, 0.0, 0.0));
            IIfcExtrudedAreaSolid      extrudedAreaSolid      = IfcTools.CreateExtrudedAreaSolid((IIfcProfileDef)IfcTools.IfcDatabase.CreateIfcCircleProfileDef(new IfcProfileTypeEnum?(IfcProfileTypeEnum.IFC_AREA), (IfcLabel)string.Empty, axis2Placement2D, (IfcPositiveLengthMeasure)radius), axis2Placement3D, IfcTools.CreateDirection(0.0, 0.0, 1.0), (IfcPositiveLengthMeasure)(height + num1 + num2));
            IIfcBooleanClippingResult  booleanClippingResult1 = (IIfcBooleanClippingResult)null;
            IIfcBooleanClippingResult  booleanClippingResult2 = (IIfcBooleanClippingResult)null;
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                booleanClippingResult2 == null ? (booleanClippingResult1 == null ? IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)extrudedAreaSolid, "Body", "SweptSolid") : IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)booleanClippingResult1, "Body", "Clipping")) : IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)booleanClippingResult2, "Body", "Clipping")
            });
            IIfcBeam beam = IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid);

            IfcTools.AddQuantities((IIfcObject)beam);
            IfcTools.AddColorToElement((IIfcElement)beam, "green");
            IfcTools.AddMaterialToElement(new List <IIfcRoot>()
            {
                (IIfcRoot)beam
            }, "Undefined");
            if (!string.IsNullOrEmpty(this.Reference))
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>()
                {
                    {
                        "PDMS_ID",
                        (object)(IfcLabel)this.Reference
                    }
                };
                IfcTools.AddProperties((IIfcObject)beam, "PDMS Common", attributes);
            }
            elements.Add((IIfcProduct)beam);
            return((IIfcElement)beam);
        }
Ejemplo n.º 3
0
 public IXbimSolid CreateSolid(IIfcExtrudedAreaSolid ifcSolid)
 {
     return(_engine.CreateSolid(ifcSolid));
 }