• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IFCAnyHandle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IFCAnyHandle的典型用法代码示例。如果您正苦于以下问题:C# IFCAnyHandle类的具体用法?C# IFCAnyHandle怎么用?C# IFCAnyHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IFCAnyHandle类属于命名空间,在下文中一共展示了IFCAnyHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Process

        override protected void Process(IFCAnyHandle ifcPolyLoop)
        {
            base.Process(ifcPolyLoop);

            List<IFCAnyHandle> ifcPolygon = 
                IFCAnyHandleUtil.GetAggregateInstanceAttribute<List<IFCAnyHandle>>(ifcPolyLoop, "Polygon");
            
            if (ifcPolygon == null)
                return; // TODO: WARN

            Polygon = IFCPoint.ProcessScaledLengthIFCCartesianPoints(ifcPolygon);

            int numVertices = Polygon.Count;
            if (numVertices > 1)
            {
                if (Polygon[0].IsAlmostEqualTo(Polygon[numVertices - 1]))
                {
                    // LOG: Warning: #: First and last points are almost identical, removing extra point.
                    Polygon.RemoveAt(numVertices - 1);
                    numVertices--;
                }
            }

            if (numVertices < 3)
                throw new InvalidOperationException("#" + ifcPolyLoop.StepId + ": Polygon attribute has only " + numVertices + " vertices, 3 expected.");
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:26,代码来源:IFCPolyLoop.cs


示例2: Process

        protected override void Process(IFCAnyHandle ifcCurve)
        {
            base.Process(ifcCurve);

            IFCAnyHandle basisCurve = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcCurve, "BasisCurve", false);
            if (basisCurve == null)
                return;

            IFCAnyHandle dir = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcCurve, "RefDirection", false);

            bool found = false;
            double distance = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(ifcCurve, "Distance", out found);
            if (!found)
                distance = 0.0;

            IFCCurve ifcBasisCurve = IFCCurve.ProcessIFCCurve(basisCurve);
            XYZ dirXYZ = (dir == null) ? ifcBasisCurve.GetNormal() : IFCPoint.ProcessNormalizedIFCDirection(dir);

            try
            {
                if (ifcBasisCurve.Curve != null)
                    Curve = ifcBasisCurve.Curve.CreateOffset(distance, XYZ.BasisZ);
                else if (ifcBasisCurve.CurveLoop != null)
                    CurveLoop = CurveLoop.CreateViaOffset(ifcBasisCurve.CurveLoop, distance, XYZ.BasisZ);
            }
            catch
            {
                Importer.TheLog.LogError(ifcCurve.StepId, "Couldn't create offset curve.", false);
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:30,代码来源:IFCOffsetCurve2D.cs


示例3: Process

        /// <summary>
        /// Processes an IfcWindowLiningProperties entity.
        /// </summary>
        /// <param name="ifcWindowLiningProperties">The IfcWindowLiningProperties handle.</param>
        protected override void Process(IFCAnyHandle ifcWindowLiningProperties)
        {
            base.Process(ifcWindowLiningProperties);

            if (m_WindowLiningPropertyDescs == null)
            {
                m_WindowLiningPropertyDescs = new List<Tuple<string, UnitType, AllowedValues>>();
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("LiningDepth", UnitType.UT_Length, AllowedValues.Positive));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("LiningThickness", UnitType.UT_Length, AllowedValues.Positive));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("TransomThickness", UnitType.UT_Length, AllowedValues.Positive));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("MullionThickness", UnitType.UT_Length, AllowedValues.Positive));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("FirstTransomOffset", UnitType.UT_Length, AllowedValues.NonNegative));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("SecondTransomOffset", UnitType.UT_Length, AllowedValues.NonNegative));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("FirstMullionOffset", UnitType.UT_Length, AllowedValues.NonNegative));
                m_WindowLiningPropertyDescs.Add(new Tuple<string, UnitType, AllowedValues>("SecondMullionOffset", UnitType.UT_Length, AllowedValues.NonNegative));
            }

            for (int ii = 0; ii < 4; ii++)
            {
                Tuple<string, UnitType, AllowedValues> propertyDesc = m_WindowLiningPropertyDescs[ii];
                // Default is nonsense value.
                double currPropertyValue = IFCImportHandleUtil.GetOptionalScaledLengthAttribute(ifcWindowLiningProperties, propertyDesc.Item1, -1e+30);
                if (!MathUtil.IsAlmostEqual(currPropertyValue , -1e+30))
                    DoubleProperties[propertyDesc] = currPropertyValue;
            }

            for (int ii = 4; ii < 8; ii++)
            {
                Tuple<string, UnitType, AllowedValues> propertyDesc = m_WindowLiningPropertyDescs[ii];
                // Default is nonsense value.
                double currPropertyValue = IFCImportHandleUtil.GetOptionalDoubleAttribute(ifcWindowLiningProperties, propertyDesc.Item1, -1e+30);
                if (!MathUtil.IsAlmostEqual(currPropertyValue, -1e+30))
                    DoubleProperties[propertyDesc] = currPropertyValue;
            }
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:39,代码来源:IFCWindowLiningProperties.cs


示例4: Process

        override protected void Process(IFCAnyHandle item)
        {
            base.Process(item);

            LayerAssignment = IFCPresentationLayerAssignment.GetTheLayerAssignment(item);

            List<IFCAnyHandle> styledByItems = IFCAnyHandleUtil.GetAggregateInstanceAttribute<List<IFCAnyHandle>>(item, "StyledByItem");
            if (styledByItems != null && styledByItems.Count > 0)
            {
                // We can only handle one styled item, but we allow the possiblity that there are duplicates.  Do a top-level check.
                foreach (IFCAnyHandle styledByItem in styledByItems)
                {
                    if (!IFCAnyHandleUtil.IsSubTypeOf(styledByItem, IFCEntityType.IfcStyledItem))
                    {
                        Importer.TheLog.LogUnexpectedTypeError(styledByItem, IFCEntityType.IfcStyledItem, false);
                        StyledByItem = null;
                        break;
                    }
                    else
                    {
                        if (StyledByItem == null)
                            StyledByItem = IFCStyledItem.ProcessIFCStyledItem(styledByItem);
                        else
                        {
                            IFCStyledItem compStyledByItem = IFCStyledItem.ProcessIFCStyledItem(styledByItem);
                            if (!StyledByItem.IsEquivalentTo(compStyledByItem))
                            {
                                Importer.TheLog.LogWarning(Id, "Multiple inconsistent styled items found for this item; using first one.", false);
                                break;
                            }
                        }
                    }
                }
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:35,代码来源:IFCRepresentationItem.cs


示例5: CreateUniformatClassification

        /// <summary>
        /// Creates uniformat classification.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC.</param>
        /// <param name="file">The file.</param>
        /// <param name="element">The element.</param>
        /// <param name="elemHnd">The element handle.</param>
        public static void CreateUniformatClassification(ExporterIFC exporterIFC, IFCFile file, Element element, IFCAnyHandle elemHnd)
        {
            // Create Uniformat classification, if it is not set.
            string uniformatKeyString = "Uniformat";
            string uniformatCode = "";
            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, BuiltInParameter.UNIFORMAT_CODE, false, out uniformatCode) == null)
                ParameterUtil.GetStringValueFromElementOrSymbol(element, "Assembly Code", out uniformatCode);
            string uniformatDescription = "";

            if (!String.IsNullOrWhiteSpace(uniformatCode))
            {
                if (ParameterUtil.GetStringValueFromElementOrSymbol(element, BuiltInParameter.UNIFORMAT_DESCRIPTION, false, out uniformatDescription) == null)
                    ParameterUtil.GetStringValueFromElementOrSymbol(element, "Assembly Description", out uniformatDescription);
            }

            IFCAnyHandle classification;
            if (!ExporterCacheManager.ClassificationCache.ClassificationHandles.TryGetValue(uniformatKeyString, out classification))
            {
                classification = IFCInstanceExporter.CreateClassification(file, "http://www.csiorg.net/uniformat", "1998", null, uniformatKeyString);
                ExporterCacheManager.ClassificationCache.ClassificationHandles.Add(uniformatKeyString, classification);
            }

                InsertClassificationReference(exporterIFC, file, element, elemHnd, uniformatKeyString, uniformatCode, uniformatDescription, "http://www.csiorg.net/uniformat" );

        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:32,代码来源:ClassificationUtil.cs


示例6: Register

        /// <summary>
        /// Adds the IfcMaterialLayerSet handle to the dictionary.
        /// </summary>
        /// <param name="elementId">
        /// The element elementId.
        /// </param>
        /// <param name="handle">
        /// The IfcMaterialLayerSet handle.
        /// </param>
        public void Register(ElementId elementId, IFCAnyHandle handle)
        {
            if (m_ElementIdToMatLayerSetDictionary.ContainsKey(elementId))
                return;

            m_ElementIdToMatLayerSetDictionary[elementId] = handle;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:16,代码来源:MaterialLayerSetCache.cs


示例7: ProcessIFCRelAssignsToGroup

 /// <summary>
 /// Processes IfcRelAssignsToGroup.
 /// </summary>
 /// <param name="isGroupedBy">The IfcRelAssignsToGroup handle.</param>
 void ProcessIFCRelAssignsToGroup(IFCAnyHandle isGroupedBy)
 {
     m_RelatedObjectType = ProcessIFCRelation.ProcessRelatedObjectType(isGroupedBy);
     // We will not process the related objects here, as that could cause infinite loops of partially processed items.
     // Instead, items will add themselves to their groups as they are processed.
     m_IFCRelatedObjects = new HashSet<IFCObjectDefinition>(); // ProcessIFCRelation.ProcessRelatedObjects(isGroupedBy);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:11,代码来源:IFCGroup.cs


示例8: Process

      /// <summary>
      /// Processes IfcSite attributes.
      /// </summary>
      /// <param name="ifcIFCSite">The IfcSite handle.</param>
      protected override void Process(IFCAnyHandle ifcIFCSite)
      {
         base.Process(ifcIFCSite);

         RefElevation = IFCImportHandleUtil.GetOptionalScaledLengthAttribute(ifcIFCSite, "RefElevation", 0.0);

         IList<int> refLatitudeList = IFCAnyHandleUtil.GetAggregateIntAttribute<List<int>>(ifcIFCSite, "RefLatitude");
         IList<int> refLongitudeList = IFCAnyHandleUtil.GetAggregateIntAttribute<List<int>>(ifcIFCSite, "RefLongitude");

         if (refLatitudeList != null)
         {
            m_RefLatitude = 0.0;
            int numLats = Math.Min(refLatitudeList.Count, 4);   // Only support up to degress, minutes, seconds, and millionths of seconds.
            for (int ii = 0; ii < numLats; ii++)
            {
               m_RefLatitude += ((double)refLatitudeList[ii]) / GetLatLongScale(ii);
            }
         }

         if (refLongitudeList != null)
         {
            m_RefLongitude = 0.0;
            int numLongs = Math.Min(refLongitudeList.Count, 4);   // Only support up to degress, minutes, seconds, and millionths of seconds.
            for (int ii = 0; ii < numLongs; ii++)
            {
               m_RefLongitude += ((double)refLongitudeList[ii]) / GetLatLongScale(ii);
            }
         }

         m_LandTitleNumber = IFCAnyHandleUtil.GetStringAttribute(ifcIFCSite, "LandTitleNumber");
      }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:35,代码来源:IFCSite.cs


示例9: Export

        /// <summary>
        /// Exports mullion.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="mullion">
        /// The mullion object.
        /// </param>
        /// <param name="geometryElement">
        /// The geometry element.
        /// </param>
        /// <param name="localPlacement">
        /// The local placement handle.
        /// </param>
        /// <param name="extraParams">
        /// The extrusion creation data.
        /// </param>
        /// <param name="setter">
        /// The IFCPlacementSetter.
        /// </param>
        /// <param name="productWrapper">
        /// The IFCProductWrapper.
        /// </param>
        public static void Export(ExporterIFC exporterIFC, Mullion mullion, GeometryElement geometryElement,
           IFCAnyHandle localPlacement, IFCExtrusionCreationData extraParams, IFCPlacementSetter setter, IFCProductWrapper productWrapper)
        {
            IFCFile file = exporterIFC.GetFile();

            ElementId catId = CategoryUtil.GetSafeCategoryId(mullion);

            BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
            IFCAnyHandle repHnd = RepresentationUtil.CreateBRepProductDefinitionShape(mullion.Document.Application, exporterIFC, mullion, catId,
                geometryElement, bodyExporterOptions, null, extraParams);
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(repHnd))
            {
                extraParams.ClearOpenings();
                return;
            }

            string elemGUID = ExporterIFCUtils.CreateGUID(mullion);
            IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
            string elemObjectType = NamingUtil.CreateIFCObjectName(exporterIFC, mullion);
            string elemId = NamingUtil.CreateIFCElementId(mullion);

            IFCAnyHandle mullionHnd = IFCInstanceExporter.CreateMember(file, elemGUID, ownerHistory, elemObjectType, null, elemObjectType,
               localPlacement, repHnd, elemId);
            productWrapper.AddElement(mullionHnd, setter, extraParams, LevelUtil.AssociateElementToLevel(mullion));

            PropertyUtil.CreateInternalRevitPropertySets(exporterIFC, mullion, productWrapper);
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:51,代码来源:MullionExporter.cs


示例10: Export

        /// <summary>
        /// Exports mullion.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="mullion">
        /// The mullion object.
        /// </param>
        /// <param name="geometryElement">
        /// The geometry element.
        /// </param>
        /// <param name="localPlacement">
        /// The local placement handle.
        /// </param>
        /// <param name="extraParams">
        /// The extrusion creation data.
        /// </param>
        /// <param name="setter">
        /// The IFCPlacementSetter.
        /// </param>
        /// <param name="productWrapper">
        /// The IFCProductWrapper.
        /// </param>
        public static void Export(ExporterIFC exporterIFC, Mullion mullion, GeometryElement geometryElement,
           IFCAnyHandle localPlacement, IFCExtrusionCreationData extraParams, IFCPlacementSetter setter, IFCProductWrapper productWrapper)
        {
            IFCFile file = exporterIFC.GetFile();

            ElementId catId = CategoryUtil.GetSafeCategoryId(mullion);


            IFCSolidMeshGeometryInfo solidMeshInfo = ExporterIFCUtils.GetSolidMeshGeometry(exporterIFC, geometryElement, Transform.Identity);
            IList<Solid> solids = solidMeshInfo.GetSolids();
            IList<Mesh> polyMeshes = solidMeshInfo.GetMeshes();

            bool tryToExportAsExtrusion = true;
            if (solids.Count != 1 || polyMeshes.Count != 0)
                tryToExportAsExtrusion = false;

            IFCAnyHandle shapeRep = BodyExporter.ExportBody(mullion.Document.Application, exporterIFC, catId, solids, polyMeshes, tryToExportAsExtrusion, extraParams);
            IList<IFCAnyHandle> shapeReps = new List<IFCAnyHandle>();
            shapeReps.Add(shapeRep);
            IFCAnyHandle repHnd = file.CreateProductDefinitionShape(IFCLabel.Create(), IFCLabel.Create(), shapeReps);

            IFCLabel elemGUID = IFCLabel.CreateGUID(mullion);
            IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
            IFCLabel elemObjectType = NamingUtil.CreateIFCObjectName(exporterIFC, mullion);
            IFCLabel elemId = NamingUtil.CreateIFCElementId(mullion);
            //IFCLabel elemType = IFCLabel.Create("MULLION");

            IFCAnyHandle mullionHnd = file.CreateMember(elemGUID, ownerHistory, elemObjectType, IFCLabel.Create(), elemObjectType,
               localPlacement, repHnd, elemId);
            productWrapper.AddElement(mullionHnd, setter, extraParams, true);
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:55,代码来源:MullionExporter.cs


示例11: GetPredefinedType

        /// <summary>
        /// Gets the predefined type from the IfcObject, depending on the file version and entity type.
        /// </summary>
        /// <param name="ifcElementAssembly">The associated handle.</param>
        /// <returns>The predefined type, if any.</returns>
        protected override string GetPredefinedType(IFCAnyHandle ifcElementAssembly)
        {
            IFCElementAssemblyType predefinedType = 
                IFCEnums.GetSafeEnumerationAttribute<IFCElementAssemblyType>(ifcElementAssembly, "PredefinedType", IFCElementAssemblyType.NotDefined);

            return predefinedType.ToString();
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:12,代码来源:IFCElementAssembly.cs


示例12: ProcessIFCCartesianPointInternal

        // This routine does no validity checking on the point, but does on attributes.
        private static XYZ ProcessIFCCartesianPointInternal(IFCAnyHandle point, IFCPointType expectedCoordinates)
        {
            IList<double> coordinates = IFCAnyHandleUtil.GetCoordinates(point);
            int numCoordinates = coordinates.Count;
            if (numCoordinates < 2)
            {
                //LOG: Warning: Expected at least 2 coordinates for IfcCartesianPoint, found {numCoordinates}.
            }
            else if (numCoordinates > 3)
            {
                //LOG: Warning: Expected at most 3 coordinates for IfcCartesianPoint, found {numCoordinates}.
            }

            if (expectedCoordinates != IFCPointType.DontCare)
            {
                if ((expectedCoordinates == IFCPointType.UVPoint) && (numCoordinates != 2))
                {
                    //LOG: Warning: Expected 2 coordinates for IfcCartesianPoint, found {numCoordinates}.
                    if (numCoordinates > 2)
                        numCoordinates = 2;               
                }
                else if ((expectedCoordinates == IFCPointType.XYZPoint) && (numCoordinates != 3))
                {
                    //LOG: Warning: Expected 3 coordinates for IfcCartesianPoint, found {numCoordinates}.
                    if (numCoordinates > 3)
                        numCoordinates = 3;
                }
            }

            return ListToXYZ(coordinates);
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:32,代码来源:IFCPoint.cs


示例13: ProcessIFCProperty

        /// <summary>
        /// Processes an IFC property.
        /// </summary>
        /// <param name="ifcProperty">The property.</param>
        /// <returns>The IFCProperty object.</returns>
        public static IFCProperty ProcessIFCProperty(IFCAnyHandle ifcProperty)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcProperty))
            {
                IFCImportFile.TheLog.LogNullError(IFCEntityType.IfcProperty);
                return null;
            }

            try
            {
                IFCEntity property;
                if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcProperty.StepId, out property))
                    return (property as IFCProperty);

                if (IFCAnyHandleUtil.IsSubTypeOf(ifcProperty, IFCEntityType.IfcComplexProperty))
                    return IFCComplexProperty.ProcessIFCComplexProperty(ifcProperty);

                if (IFCAnyHandleUtil.IsSubTypeOf(ifcProperty, IFCEntityType.IfcSimpleProperty))
                    return IFCSimpleProperty.ProcessIFCSimpleProperty(ifcProperty);
            }
            catch (Exception ex)
            {
                IFCImportFile.TheLog.LogError(ifcProperty.StepId, ex.Message, false);
                return null;
            }

            IFCImportFile.TheLog.LogUnhandledSubTypeError(ifcProperty, IFCEntityType.IfcProperty, false);
            return null;
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:34,代码来源:IFCProperty.cs


示例14: Process

        /// <summary>
        /// Processes IfcSite attributes.
        /// </summary>
        /// <param name="ifcIFCSite">The IfcSite handle.</param>
        protected override void Process(IFCAnyHandle ifcIFCSite)
        {
            base.Process(ifcIFCSite);
            
            RefElevation = IFCImportHandleUtil.GetOptionalScaledLengthAttribute(ifcIFCSite, "RefElevation", 0.0);

            IList<int> refLatitudeList = IFCAnyHandleUtil.GetAggregateIntAttribute<List<int>>(ifcIFCSite, "RefLatitude");
            IList<int> refLongitudeList = IFCAnyHandleUtil.GetAggregateIntAttribute<List<int>>(ifcIFCSite, "RefLongitude");

            if (refLatitudeList != null)
            {
                m_RefLatitude = 0.0;
                double latLongScaler = 1.0;
                foreach (double latVal in refLatitudeList)
                {
                    m_RefLatitude += ((double)latVal) / latLongScaler;
                    latLongScaler *= 60.0;
                }
            }
                
            if (refLongitudeList != null)
            {
                m_RefLongitude = 0.0;
                double latLongScaler = 1.0;
                foreach (double longVal in refLongitudeList)
                {
                    m_RefLongitude += ((double)longVal) / latLongScaler;
                    latLongScaler *= 60.0;
                }
            }

            m_LandTitleNumber = IFCAnyHandleUtil.GetStringAttribute(ifcIFCSite, "LandTitleNumber");
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:37,代码来源:IFCSite.cs


示例15: Process

        /// <summary>
        /// Processes IfcOpeningElement attributes.
        /// </summary>
        /// <param name="ifcOpeningElement">The IfcOpeningElement handle.</param>
        protected override void Process(IFCAnyHandle ifcOpeningElement)
        {
            base.Process(ifcOpeningElement);

            ICollection<IFCAnyHandle> hasFillings = IFCAnyHandleUtil.GetAggregateInstanceAttribute<List<IFCAnyHandle>>(ifcOpeningElement, "HasFillings");
            if (hasFillings != null)
            {
                // Assume that there is only one filling for the opening, and take first found.
                foreach (IFCAnyHandle hasFilling in hasFillings)
                {
                    IFCAnyHandle relatedFillingElement = IFCAnyHandleUtil.GetInstanceAttribute(hasFilling, "RelatedBuildingElement");
                    if (IFCAnyHandleUtil.IsNullOrHasNoValue(relatedFillingElement))
                        continue;

                    IFCEntity filledByElement;
                    IFCImportFile.TheFile.EntityMap.TryGetValue(relatedFillingElement.StepId, out filledByElement);
                    if (filledByElement == null)
                        FilledByElement = IFCElement.ProcessIFCElement(relatedFillingElement);
                    else
                        FilledByElement = filledByElement as IFCElement;
                    FilledByElement.FillsOpening = this;
                    break;
                }
            } 
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:29,代码来源:IFCOpeningElement.cs


示例16: CreateUniformatClassification

        /// <summary>
        /// Creates uniformat classification.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC.</param>
        /// <param name="file">The file.</param>
        /// <param name="element">The element.</param>
        /// <param name="elemHnd">The element handle.</param>
        public static void CreateUniformatClassification(ExporterIFC exporterIFC, IFCFile file, Element element, IFCAnyHandle elemHnd)
        {
            // Create Uniformat classification, if it is set.
            string uniformatCode = "";
            if (ParameterUtil.GetStringValueFromElementOrSymbol(element, BuiltInParameter.UNIFORMAT_CODE, false, out uniformatCode) ||
                ParameterUtil.GetStringValueFromElementOrSymbol(element, "Assembly Code", out uniformatCode))
            {
                string uniformatDescription = "";
                if (!ParameterUtil.GetStringValueFromElementOrSymbol(element, BuiltInParameter.UNIFORMAT_DESCRIPTION, false, out uniformatDescription))
                    ParameterUtil.GetStringValueFromElementOrSymbol(element, "Assembly Description", out uniformatDescription);

                IFCAnyHandle classification;
                if (!ExporterCacheManager.ClassificationCache.TryGetValue("UniFormat", out classification))
                {
                    classification = IFCInstanceExporter.CreateClassification(file, "http://www.csiorg.net/uniformat", "1998", null, "UniFormat");
                    ExporterCacheManager.ClassificationCache.Add("UniFormat", classification);
                }

                IFCAnyHandle classificationReference = IFCInstanceExporter.CreateClassificationReference(file,
                  "http://www.csiorg.net/uniformat", uniformatCode, uniformatDescription, classification);

                HashSet<IFCAnyHandle> relatedObjects = new HashSet<IFCAnyHandle>();
                relatedObjects.Add(elemHnd);

                IFCAnyHandle relAssociates = IFCInstanceExporter.CreateRelAssociatesClassification(file, ExporterIFCUtils.CreateGUID(),
                   exporterIFC.GetOwnerHistoryHandle(), "UniFormatClassification", "", relatedObjects, classificationReference);
            }
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:35,代码来源:ClassificationUtil.cs


示例17: ValidateRoot

        /// <summary>
        /// Validates the values to be set to IfcRoot.
        /// </summary>
        /// <param name="guid">The GUID.</param>
        /// <param name="ownerHistory">The owner history.</param>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        private static void ValidateRoot(string guid, IFCAnyHandle ownerHistory, string name, string description)
        {
            if (String.IsNullOrEmpty(guid))
                throw new ArgumentException("Invalid guid.", "guid");

            IFCAnyHandleUtil.ValidateSubTypeOf(ownerHistory, false, IFCEntityType.IfcOwnerHistory);
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:14,代码来源:IFCInstanceExporter.cs


示例18: Process

        protected override void Process(IFCAnyHandle ifcCurve)
        {
            base.Process(ifcCurve);

            bool found = false;
            double radius = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(ifcCurve, "Radius", out found);
            if (!found)
            {
               Importer.TheLog.LogError(ifcCurve.StepId, "Cannot find the radius of this circle", false);
               return;
            }

            try
            {
               Curve = Arc.Create(Position.Origin, radius, 0, 2.0 * Math.PI, Position.BasisX, Position.BasisY);
            }
            catch (Exception ex)
            {
               if (ex.Message.Contains("too small"))
               {
                  string lengthAsString = UnitFormatUtils.Format(IFCImportFile.TheFile.Document.GetUnits(), UnitType.UT_Length, radius, true, false);
                  Importer.TheLog.LogError(Id, "Found a circle with radius of " + lengthAsString + ", ignoring.", false);
                  Curve = null;
               }
               else
                  Importer.TheLog.LogError(Id, ex.Message, false);
               Curve = null;
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:29,代码来源:IFCCircle.cs


示例19: Process

        override protected void Process(IFCAnyHandle item)
        {
            base.Process(item);

            SurfaceSide = IFCEnums.GetSafeEnumerationAttribute<IFCSurfaceSide>(item, "Side", IFCSurfaceSide.Both);

            HashSet<IFCAnyHandle> styles = IFCAnyHandleUtil.GetAggregateInstanceAttribute<HashSet<IFCAnyHandle>>(item, "Styles");
            if (styles == null || styles.Count == 0)
                Importer.TheLog.LogError(item.StepId, "No style information found, ignoring.", true);

            foreach (IFCAnyHandle style in styles)
            {
                try
                {
                    if (IFCAnyHandleUtil.IsSubTypeOf(style, IFCEntityType.IfcSurfaceStyleShading))
                    {
                        if (ShadingStyle == null)
                            ShadingStyle = IFCSurfaceStyleShading.ProcessIFCSurfaceStyleShading(style);
                        else
                            Importer.TheLog.LogWarning(item.StepId, "Duplicate IfcSurfaceStyleShading, ignoring.", false);
                    }
                    else
                        Importer.TheLog.LogUnhandledSubTypeError(style, "IfcSurfaceStyleElementSelect", false);
                }
                catch (Exception ex)
                {
                    Importer.TheLog.LogError(style.StepId, ex.Message, false);
                }
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:30,代码来源:IFCSurfaceStyle.cs


示例20: Process

        override protected void Process(IFCAnyHandle ifcSurface)
        {
            base.Process(ifcSurface);

            IFCAnyHandle position = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcSurface, "Position", true);
            Position = IFCLocation.ProcessIFCAxis2Placement(position);
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:7,代码来源:IFCElementarySurface.cs



注:本文中的IFCAnyHandle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IFCExportType类代码示例发布时间:2022-05-24
下一篇:
C# IExtensionManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap