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

C# ExporterIFC类代码示例

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

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



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

示例1: 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


示例2: Calculate

 /// <summary>
 /// Calculates span value for a beam.
 /// </summary>
 /// <param name="exporterIFC">
 /// The ExporterIFC object.
 /// </param>
 /// <param name="extrusionCreationData">
 /// The IFCExtrusionCreationData.
 /// </param>
 /// <param name="element">
 /// The element to calculate the value.
 /// </param>
 /// <param name="elementType">
 /// The element type.
 /// </param>
 /// <returns>
 /// True if the operation succeed, false otherwise.
 /// </returns>
 public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
 {
     if (extrusionCreationData == null || MathUtil.IsAlmostZero(extrusionCreationData.ScaledLength))
         return false;
     m_Span = extrusionCreationData.ScaledLength;
     return true;
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:25,代码来源:BeamSpanCalculator.cs


示例3: Calculate

 /// <summary>
 /// Calculates shape parameter B for a rebar.
 /// </summary>
 /// <param name="exporterIFC">The ExporterIFC object.</param>
 /// <param name="extrusionCreationData">The IFCExtrusionCreationData.</param>
 /// <param name="element">The element to calculate the value.</param>
 /// <param name="elementType">The element type.</param>
 /// <returns>
 /// True if the operation succeed, false otherwise.
 /// </returns>
 public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
 {
     bool ret = (ParameterUtil.GetDoubleValueFromElement(element, BuiltInParameterGroup.PG_GEOMETRY, "B", out m_ShapeParameterB) != null);
     if (ret)
         m_ShapeParameterB = m_ShapeParameterB * exporterIFC.LinearScale;
     return ret;
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:17,代码来源:ISOCD3766ShapeParameterBCalculator.cs


示例4: Calculate

        /// <summary>
        /// Calculates the end hook angle for a rebar.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="extrusionCreationData">The IFCExtrusionCreationData.</param>
        /// <param name="element">The element to calculate the value.</param>
        /// <param name="elementType">The element type.</param>
        /// <returns>
        /// True if the operation succeed, false otherwise.
        /// </returns>
        public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
        {
            RebarBendData bendData = null;
            if (element is Rebar)
                bendData = (element as Rebar).GetBendData();
            else if (element is RebarInSystem)
                bendData = (element as RebarInSystem).GetBendData();
            
            if (bendData != null)
            {
                if (bendData.HookLength1 > MathUtil.Eps())
                {
                    ElementId hookAtEndTypeId;
                    if (ParameterUtil.GetElementIdValueFromElement(element, BuiltInParameter.REBAR_ELEM_HOOK_END_TYPE, out hookAtEndTypeId) != null)
                    {
                        RebarHookType rebarHookType = element.Document.GetElement(hookAtEndTypeId) as RebarHookType;
                        if (rebarHookType != null)
                        {
							//HookAngle is measured in radians, so scale directly.
                            m_Angle = rebarHookType.HookAngle *180 / Math.PI;
                            return true;
                        }
                    }
                }
            }
            return false;
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:37,代码来源:ISOCD3766BendingEndHookCalculator.cs


示例5: Calculate

 /// <summary>
 /// Calculates slope value for a beam.
 /// </summary>
 /// <param name="exporterIFC">
 /// The ExporterIFC object.
 /// </param>
 /// <param name="extrusionCreationData">
 /// The IFCExtrusionCreationData.
 /// </param>
 /// <param name="element">
 /// The element to calculate the value.
 /// </param>
 /// <param name="elementType">
 /// The element type.
 /// </param>
 /// <returns>
 /// True if the operation succeed, false otherwise.
 /// </returns>
 public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
 {
     if (extrusionCreationData == null)
         return false;
     m_Slope = extrusionCreationData.Slope;
     return true;
 }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:25,代码来源:BeamSlopeCalculator.cs


示例6: Export

        /// <summary>
        /// Exports a Rebar, AreaReinforcement or PathReinforcement to IFC ReinforcingBar.
        /// </summary>
        /// <param name="exporterIFC">The exporter.</param>
        /// <param name="element">The element.</param>
        /// <param name="filterView">The view.</param>
        /// <param name="productWrapper">The product wrapper.</param>
        public static void Export(ExporterIFC exporterIFC,
            Element element, Autodesk.Revit.DB.View filterView, ProductWrapper productWrapper)
        {
            if (element is Rebar)
            {
                ExportRebar(exporterIFC, element, filterView, productWrapper);
            }
            else if (element is AreaReinforcement)
            {
                AreaReinforcement areaReinforcement = element as AreaReinforcement;
                IList<ElementId> rebarIds = areaReinforcement.GetRebarInSystemIds();

                Document doc = areaReinforcement.Document;
                foreach (ElementId id in rebarIds)
                {
                    Element rebarInSystem = doc.GetElement(id);
                    ExportRebar(exporterIFC, rebarInSystem, filterView, productWrapper);
                }
            }
            else if (element is PathReinforcement)
            {
                PathReinforcement pathReinforcement = element as PathReinforcement;
                IList<ElementId> rebarIds = pathReinforcement.GetRebarInSystemIds();

                Document doc = pathReinforcement.Document;
                foreach (ElementId id in rebarIds)
                {
                    Element rebarInSystem = doc.GetElement(id);
                    ExportRebar(exporterIFC, rebarInSystem, filterView, productWrapper);
                }
            }
        }
开发者ID:stiter,项目名称:ifcexporter,代码行数:39,代码来源:RebarExporter.cs


示例7: 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


示例8: SetBestMaterialIdInExporter

        /// <summary>
        /// Sets best material id for current export state.
        /// </summary>
        /// <param name="geometryObject">The geometry object to get the best material id.</param>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        public static void SetBestMaterialIdInExporter(GeometryObject geometryObject, ExporterIFC exporterIFC)
        {
            ElementId materialId = GetBestMaterialIdForGeometry(geometryObject, exporterIFC);

            if (materialId != ElementId.InvalidElementId)
                exporterIFC.SetMaterialIdForCurrentExportState(materialId);
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:12,代码来源:BodyExporter.cs


示例9: ExportAssemblyInstanceElement

        /// <summary>
        /// Exports an element as an IFC assembly.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="element">The element.</param>
        /// <param name="geometryElement">The geometry element.</param>
        /// <param name="productWrapper">The IFCProductWrapper.</param>
        /// <returns>True if exported successfully, false otherwise.</returns>
        public static bool ExportAssemblyInstanceElement(ExporterIFC exporterIFC, AssemblyInstance element,
            IFCProductWrapper productWrapper)
        {
            if (element == null)
                return false;

            IFCFile file = exporterIFC.GetFile();

            using (IFCTransaction tr = new IFCTransaction(file))
            {
                using (IFCPlacementSetter placementSetter = IFCPlacementSetter.Create(exporterIFC, element))
                {
                    string guid = ExporterIFCUtils.CreateGUID(element);
                    IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
                    string name = exporterIFC.GetName();
                    string objectType = exporterIFC.GetFamilyName();
                    IFCAnyHandle localPlacement = placementSetter.GetPlacement();
                    IFCAnyHandle representation = null;
                    string elementTag = NamingUtil.CreateIFCElementId(element);
                    IFCElementAssemblyType predefinedType = GetPredefinedTypeFromObjectType(objectType);

                    IFCAnyHandle assemblyInstanceHnd = IFCInstanceExporter.CreateElementAssembly(file, guid,
                        ownerHistory, name, null, objectType, localPlacement, representation, elementTag,
                        IFCAssemblyPlace.NotDefined, predefinedType);

                    productWrapper.AddElement(assemblyInstanceHnd, placementSetter.GetLevelInfo(), null, true);

                    PropertyUtil.CreateInternalRevitPropertySets(exporterIFC, element, productWrapper);

                    ExporterCacheManager.AssemblyInstanceCache.RegisterAssemblyInstance(element.Id, assemblyInstanceHnd);
                }
                tr.Commit();
                return true;
            }
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:43,代码来源:AssemblyInstanceExporter.cs


示例10: 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


示例11: ExportFooting

        /// <summary>
        /// Exports an element to IFC footing.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="element">
        /// The element.
        /// </param>
        /// <param name="geometryElement">
        /// The geometry element.
        /// </param>
        /// <param name="ifcEnumType">
        /// The string value represents the IFC type.
        /// </param>
        /// <param name="productWrapper">
        /// The IFCProductWrapper.
        /// </param>
        public static void ExportFooting(ExporterIFC exporterIFC, Element element, GeometryElement geometryElement,
           string ifcEnumType, IFCProductWrapper productWrapper)
        {
            // export parts or not
            bool exportParts = PartExporter.CanExportParts(element);
            if (exportParts && !PartExporter.CanExportElementInPartExport(element, element.Level.Id, false))
                return;

            IFCFile file = exporterIFC.GetFile();

            using (IFCTransaction tr = new IFCTransaction(file))
            {
                using (IFCPlacementSetter setter = IFCPlacementSetter.Create(exporterIFC, element))
                {
                    using (IFCExtrusionCreationData ecData = new IFCExtrusionCreationData())
                    {                      
                        ecData.SetLocalPlacement(setter.GetPlacement());
                      
                        IFCAnyHandle prodRep = null;
                        if (!exportParts)
                        {
                            ElementId catId = CategoryUtil.GetSafeCategoryId(element);

                            BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
                            prodRep = RepresentationUtil.CreateBRepProductDefinitionShape(element.Document.Application, exporterIFC,
                               element, catId, geometryElement, bodyExporterOptions, null, ecData);
                            if (IFCAnyHandleUtil.IsNullOrHasNoValue(prodRep))
                            {
                                ecData.ClearOpenings();
                                return;
                            }
                        }

                        string instanceGUID = ExporterIFCUtils.CreateGUID(element);
                        string origInstanceName = exporterIFC.GetName();
                        string instanceName = NamingUtil.GetNameOverride(element, origInstanceName);
                        string instanceDescription = NamingUtil.GetDescriptionOverride(element, null);
                        string instanceObjectType = NamingUtil.GetObjectTypeOverride(element, exporterIFC.GetFamilyName());
                        string instanceElemId = NamingUtil.CreateIFCElementId(element);
                        Toolkit.IFCFootingType footingType = GetIFCFootingType(element, ifcEnumType);

                        IFCAnyHandle footing = IFCInstanceExporter.CreateFooting(file, instanceGUID, exporterIFC.GetOwnerHistoryHandle(),
                            instanceName, instanceDescription, instanceObjectType, ecData.GetLocalPlacement(), prodRep, instanceElemId, footingType);

                        if (exportParts)
                        {
                            PartExporter.ExportHostPart(exporterIFC, element, footing, productWrapper, setter, setter.GetPlacement(), null);
                        }

                        productWrapper.AddElement(footing, setter, ecData, LevelUtil.AssociateElementToLevel(element));

                        OpeningUtil.CreateOpeningsIfNecessary(footing, element, ecData, exporterIFC, ecData.GetLocalPlacement(), setter, productWrapper);

                        PropertyUtil.CreateInternalRevitPropertySets(exporterIFC, element, productWrapper);
                    }
                }

                tr.Commit();
            }
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:78,代码来源:FootingExporter.cs


示例12: CreateBaseShapeRepresentation

 /// <summary>
 /// Creates a shape representation and register it to shape representation layer.
 /// </summary>
 /// <param name="exporterIFC">The ExporterIFC object.</param>
 /// <param name="contextOfItems">The context for which the different subtypes of representation are valid.</param>
 /// <param name="identifier">The identifier for the representation.</param>
 /// <param name="representationType">The type handle for the representation.</param>
 /// <param name="items">Collection of geometric representation items that are defined for this representation.</param>
 /// <returns>The handle.</returns>
 public static IFCAnyHandle CreateBaseShapeRepresentation(ExporterIFC exporterIFC, IFCAnyHandle contextOfItems,
    string identifier, string representationType, ISet<IFCAnyHandle> items)
 {
     IFCFile file = exporterIFC.GetFile();
     IFCAnyHandle newShapeRepresentation = IFCInstanceExporter.CreateShapeRepresentation(file, contextOfItems, identifier, representationType, items);
     return newShapeRepresentation;
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:16,代码来源:RepresentationUtil.cs


示例13: Calculate

 /// <summary>
 /// Calculates shape parameter A for a rebar.
 /// </summary>
 /// <param name="exporterIFC">The ExporterIFC object.</param>
 /// <param name="extrusionCreationData">The IFCExtrusionCreationData.</param>
 /// <param name="element">The element to calculate the value.</param>
 /// <param name="elementType">The element type.</param>
 /// <returns>
 /// True if the operation succeed, false otherwise.
 /// </returns>
 public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
 {
     bool ret = (ParameterUtil.GetDoubleValueFromElement(element, BuiltInParameterGroup.PG_GEOMETRY, "A", out m_ShapeParameterA) != null);
     if (ret)
         m_ShapeParameterA = UnitUtil.ScaleLength(m_ShapeParameterA);
     return ret;
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:17,代码来源:ISOCD3766ShapeParameterACalculator.cs


示例14: Calculate

 /// <summary>
 /// Calculates perimeter for a slab.
 /// </summary>
 /// <param name="exporterIFC">
 /// The ExporterIFC object.
 /// </param>
 /// <param name="extrusionCreationData">
 /// The IFCExtrusionCreationData.
 /// </param>
 /// <param name="element">
 /// The element to calculate the value.
 /// </param>
 /// <param name="elementType">
 /// The element type.
 /// </param>
 /// <returns>
 /// True if the operation succeed, false otherwise.
 /// </returns>
 public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
 {
     if (extrusionCreationData == null)
         return false;
     m_Perimeter = extrusionCreationData.ScaledOuterPerimeter;
     return m_Perimeter > MathUtil.Eps();
 }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:25,代码来源:SlabPerimeterCalculator.cs


示例15: Calculate

 /// <summary>
 /// Calculates width for a slab.
 /// </summary>
 /// <param name="exporterIFC">
 /// The ExporterIFC object.
 /// </param>
 /// <param name="extrusionCreationData">
 /// The IFCExtrusionCreationData.
 /// </param>
 /// <param name="element">
 /// The element to calculate the value.
 /// </param>
 /// <param name="elementType">
 /// The element type.
 /// </param>
 /// <returns>
 /// True if the operation succeed, false otherwise.
 /// </returns>
 public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
 {
     if (extrusionCreationData == null)
         return false;
     m_Width = extrusionCreationData.ScaledLength;
     return m_Width > MathUtil.Eps();
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:25,代码来源:SlabWidthCalculator.cs


示例16: ExportCeilingElement

 /// <summary>
 /// Exports a ceiling to IFC covering.
 /// </summary>
 /// <param name="exporterIFC">
 /// The ExporterIFC object.
 /// </param>
 /// <param name="ceiling">
 /// The ceiling element to be exported.
 /// </param>
 /// <param name="geomElement">
 /// The geometry element.
 /// </param>
 /// <param name="productWrapper">
 /// The ProductWrapper.
 /// </param>
 public static void ExportCeilingElement(ExporterIFC exporterIFC, Ceiling ceiling, GeometryElement geomElement, ProductWrapper productWrapper)
 {
     string ifcEnumType = CategoryUtil.GetIFCEnumTypeName(exporterIFC, ceiling);
     if (String.IsNullOrEmpty(ifcEnumType))
         ifcEnumType = "CEILING";
     ExportCovering(exporterIFC, ceiling, geomElement, ifcEnumType, productWrapper);
 }
开发者ID:stiter,项目名称:ifcexporter,代码行数:22,代码来源:CeilingExporter.cs


示例17: ExportFabricArea

        /// <summary>
        /// Exports a FabricArea as an IfcGroup.  There is no geometry to export.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="element">The element.</param>
        /// <param name="productWrapper">The ProductWrapper.</param>
        /// <returns>True if exported successfully, false otherwise.</returns>
        public static bool ExportFabricArea(ExporterIFC exporterIFC, Element element, ProductWrapper productWrapper)
        {
            if (element == null)
                return false;

            HashSet<IFCAnyHandle> fabricSheetHandles = null;
            if (!ExporterCacheManager.FabricAreaHandleCache.TryGetValue(element.Id, out fabricSheetHandles))
                return false;

            if (fabricSheetHandles == null || fabricSheetHandles.Count == 0)
                return false;

            IFCFile file = exporterIFC.GetFile();

            using (IFCTransaction tr = new IFCTransaction(file))
            {
                string guid = GUIDUtil.CreateGUID(element);
                IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
                string revitObjectType = exporterIFC.GetFamilyName();
                string name = NamingUtil.GetNameOverride(element, revitObjectType);
                string description = NamingUtil.GetDescriptionOverride(element, null);
                string objectType = NamingUtil.GetObjectTypeOverride(element, revitObjectType);

                IFCAnyHandle fabricArea = IFCInstanceExporter.CreateGroup(file, guid,
                    ownerHistory, name, description, objectType);

                productWrapper.AddElement(element, fabricArea);

                IFCInstanceExporter.CreateRelAssignsToGroup(file, GUIDUtil.CreateGUID(), ownerHistory,
                    null, null, fabricSheetHandles, null, fabricArea);

                tr.Commit();
                return true;
            }
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:42,代码来源:FabricSheetExporter.cs


示例18: 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


示例19: Calculate

        /// <summary>
        /// Calculates temperature value for a space.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="extrusionCreationData">The IFCExtrusionCreationData.</param>
        /// <param name="element">The element to calculate the value.</param>
        /// <param name="elementType">The element type.</param>
        /// <returns>True if the operation succeed, false otherwise.</returns>
        public override bool Calculate(ExporterIFC exporterIFC, IFCExtrusionCreationData extrusionCreationData, Element element, ElementType elementType)
        {
            if (!string.IsNullOrEmpty(m_Name))
            {
                string temperatureName, temperatureNameMax, temperatureNameMin;
                if (string.Compare(m_Name, "SpaceTemperatureSummer") == 0)
                {
                    temperatureName = "SpaceTemperatureSummer";
                    temperatureNameMax = "SpaceTemperatureSummerMax";
                    temperatureNameMin = "SpaceTemperatureSummerMin";
                }
                else if (string.Compare(m_Name, "SpaceTemperatureWinter") == 0)
                {
                    temperatureName = "SpaceTemperatureWinter";
                    temperatureNameMax = "SpaceTemperatureWinterMax";
                    temperatureNameMin = "SpaceTemperatureWinterMin";
                }
                else
                    return false;

                if (ParameterUtil.GetDoubleValueFromElementOrSymbol(element, temperatureName, out m_Temperature) != null)
                    return true;

                double maxValue = 0, minValue = 0;
                if ((ParameterUtil.GetDoubleValueFromElementOrSymbol(element, temperatureNameMax, out maxValue) != null) &&
                    (ParameterUtil.GetDoubleValueFromElementOrSymbol(element, temperatureNameMin, out minValue) != null))
                {
                    m_Temperature = (maxValue + minValue) / 2.0;
                    return true;
                }
            }

            return false;
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:42,代码来源:SpaceTemperatureCalculator.cs


示例20: CreateFrequencyPropertyFromElement

 /// <summary>
 /// Create a Frequency measure property from the element's parameter.
 /// </summary>
 /// <param name="file">The IFC file.</param>
 /// <param name="exporterIFC">The ExporterIFC.</param>
 /// <param name="elem">The Element.</param>
 /// <param name="revitParameterName">The name of the parameter.</param>
 /// <param name="ifcPropertyName">The name of the property.</param>
 /// <param name="valueType">The value type of the property.</param>
 /// <returns>The created property handle.</returns>
 public static IFCAnyHandle CreateFrequencyPropertyFromElement(IFCFile file, ExporterIFC exporterIFC, Element elem,
     string revitParameterName, string ifcPropertyName, PropertyValueType valueType)
 {
     double propertyValue;
     if (ParameterUtil.GetDoubleValueFromElement(elem, null, revitParameterName, out propertyValue) != null)
         return CreateFrequencyProperty(file, ifcPropertyName, propertyValue, valueType);
     return null;
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:18,代码来源:FrequencyPropertyUtil.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ExposeEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# ExportProvider类代码示例发布时间: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