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

C# IFCExportType类代码示例

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

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



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

示例1: IsMEPType

 /// <summary>
 /// Checks if the element is MEP type.
 /// </summary>
 /// <param name="exporterIFC">The IFC exporter object.</param>
 /// <param name="element">The element to check.</param>
 /// <returns>True for MEP type of elements.</returns>
 private bool IsMEPType(ExporterIFC exporterIFC, Element element, IFCExportType exportType)
 {
     return ElementFilteringUtil.IsMEPType(exportType);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:10,代码来源:Exporter.cs


示例2: ExportAsProxy

 /// <summary>
 /// Checks if exporting an element as building elment proxy.
 /// </summary>
 /// <param name="element">The element.</param>
 /// <returns>True for exporting as proxy element.</returns>
 private bool ExportAsProxy(Element element, IFCExportType exportType)
 {
     // FaceWall should be exported as IfcWall.
     return ((element is FaceWall) || (element is ModelText) || (exportType == IFCExportType.IfcBuildingElementProxy) || (exportType == IFCExportType.IfcBuildingElementProxyType));
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:10,代码来源:Exporter.cs


示例3: ExportFamilyInstanceAsMappedItem

        /// <summary>
        /// Exports a family instance as a mapped item.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="familyInstance">
        /// The family instance to be exported.
        /// </param>
        /// <param name="exportType">
        /// The export type.
        /// </param>
        /// <param name="ifcEnumType">
        /// The string value represents the IFC type.
        /// </param>
        /// <param name="wrapper">
        /// The ProductWrapper.
        /// </param>
        /// <param name="overrideLevelId">
        /// The level id.
        /// </param>
        /// <param name="range">
        /// The range of this family instance to be exported.
        /// </param>
        public static void ExportFamilyInstanceAsMappedItem(ExporterIFC exporterIFC,
            FamilyInstance familyInstance, IFCExportType exportType, string ifcEnumType,
            ProductWrapper wrapper, ElementId overrideLevelId, IFCRange range, IFCAnyHandle parentLocalPlacement)
        {
            bool exportParts = PartExporter.CanExportParts(familyInstance);
            bool isSplit = range != null;
            if (exportParts && !PartExporter.CanExportElementInPartExport(familyInstance, isSplit ? overrideLevelId : familyInstance.Level.Id, isSplit))
                return;

            Document doc = familyInstance.Document;
            IFCFile file = exporterIFC.GetFile();

            FamilySymbol familySymbol = ExporterIFCUtils.GetOriginalSymbol(familyInstance);
            if (familySymbol == null)
                return;

            ProductWrapper familyProductWrapper = ProductWrapper.Create(wrapper);
            double scale = exporterIFC.LinearScale;
            Options options = GeometryUtil.GetIFCExportGeometryOptions();

            IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();

            HostObject hostElement = familyInstance.Host as HostObject; //hostElement could be null
            ElementId categoryId = CategoryUtil.GetSafeCategoryId(familySymbol);

            //string emptyString = "";
            string familyName = familySymbol.Name;
            string objectType = familyName;

            // A Family Instance can have its own copy of geometry, or use the symbol's copy with a transform.
            // The routine below tells us whether to use the Instance's copy or the Symbol's copy.
            bool useInstanceGeometry = ExporterIFCUtils.UsesInstanceGeometry(familyInstance);

            IList<IFCExtrusionData> cutPairOpeningsForColumns = new List<IFCExtrusionData>();
            using (IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData())
            {
                Transform trf = familyInstance.GetTransform();

                // Extra information if we are exporting a door or a window.
                IFCDoorWindowInfo doorWindowInfo = null;
                if (exportType == IFCExportType.ExportDoorType)
                    doorWindowInfo = IFCDoorWindowInfo.CreateDoorInfo(exporterIFC, familyInstance, familySymbol, hostElement, overrideLevelId, trf);
                else if (exportType == IFCExportType.ExportWindowType)
                    doorWindowInfo = IFCDoorWindowInfo.CreateWindowInfo(exporterIFC, familyInstance, familySymbol, hostElement, overrideLevelId, trf);

                FamilyTypeInfo typeInfo = new FamilyTypeInfo();
                XYZ extraOffset = XYZ.Zero;

                bool flipped = doorWindowInfo != null ? doorWindowInfo.IsSymbolFlipped : false;
                FamilyTypeInfo currentTypeInfo = ExporterCacheManager.TypeObjectsCache.Find(familySymbol.Id, flipped);
                bool found = currentTypeInfo.IsValid();

                Family family = familySymbol.Family;

                // TODO: this code to be removed by ExtrusionAnalyzer code.
                bool trySpecialColumnCreation = ((exportType == IFCExportType.ExportColumnType) && (!family.IsInPlace));
                IList<GeometryObject> geomObjects = new List<GeometryObject>();
                Transform brepOffsetTransform = null;

                Transform doorWindowTrf = Transform.Identity;
                // We will create a new mapped type if:
                // 1.  We are exporting part of a column or in-place wall (range != null), OR
                // 2.  We are using the instance's copy of the geometry (that it, it has unique geometry), OR
                // 3.  We haven't already created the type.
                bool creatingType = ((range != null) || useInstanceGeometry || !found);
                if (creatingType)
                {
                    IFCAnyHandle bodyRepresentation = null;
                    IFCAnyHandle planRepresentation = null;

                    // If we are using the instance geometry, ignore the transformation.
                    if (useInstanceGeometry)
                        trf = Transform.Identity;

                    // TODO: this code to be removed by ExtrusionAnalyzer code.
                    if (trySpecialColumnCreation)
//.........这里部分代码省略.........
开发者ID:stiter,项目名称:ifcexporter,代码行数:101,代码来源:FamilyInstanceExporter.cs


示例4: IsEnergyConversionDeviceSubType

 /// <summary>
 /// Checks if export type is conversion device.
 /// </summary>
 /// <param name="exportType">
 /// The export type.
 /// </param>
 /// <returns>
 /// True if it is conversion device, false otherwise.
 /// </returns>
 public static bool IsEnergyConversionDeviceSubType(IFCExportType exportType)
 {
     return (exportType >= IFCExportType.ExportAirToAirHeatRecoveryType &&
        exportType <= IFCExportType.ExportUnitaryEquipmentType);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:14,代码来源:FamilyExporterUtil.cs


示例5: IsFlowMovingDeviceSubType

 /// <summary>
 /// Checks if export type is flow moving device.
 /// </summary>
 /// <param name="exportType">
 /// The export type.
 /// </param>
 /// <returns>
 /// True if it is flow moving device, false otherwise.
 /// </returns>
 public static bool IsFlowMovingDeviceSubType(IFCExportType exportType)
 {
     return (exportType >= IFCExportType.ExportCompressorType &&
        exportType <= IFCExportType.ExportPumpType);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:14,代码来源:FamilyExporterUtil.cs


示例6: IsDistributionControlElementSubType

 /// <summary>
 /// Checks if export type is distribution control element.
 /// </summary>
 /// <param name="exportType">
 /// The export type.
 /// </param>
 /// <returns>
 /// True if it is distribution control element, false otherwise.
 /// </returns>
 public static bool IsDistributionControlElementSubType(IFCExportType exportType)
 {
     return (exportType >= IFCExportType.ExportActuatorType && exportType <= IFCExportType.ExportSensorType);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:13,代码来源:FamilyExporterUtil.cs


示例7: IsDistributionFlowElementSubType

 /// <summary>
 /// Checks if export type is distribution flow element.
 /// </summary>
 /// <param name="exportType">
 /// The export type.
 /// </param>
 /// <returns>
 /// True if it is distribution flow element, false otherwise.
 /// </returns>
 public static bool IsDistributionFlowElementSubType(IFCExportType exportType)
 {
     return (exportType >= IFCExportType.ExportDistributionChamberElementType &&
        exportType <= IFCExportType.ExportFlowController);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:14,代码来源:FamilyExporterUtil.cs


示例8: ExportGenericType

        /// <summary>
        /// Exports IFC type.
        /// </summary>
        /// <remarks>
        /// This method will override the default value of the elemId label for certain element types, and then pass it on
        /// to the generic routine.
        /// </remarks>
        /// <param name="exporterIFC">The ExporterIFC class.</param>
        /// <param name="type">The export type.</param>
        /// <param name="ifcEnumType">The string value represents the IFC type.</param>
        /// <param name="guid">The guid.</param>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="applicableOccurrence">The optional data type of the entity.</param>
        /// <param name="propertySets">The property sets.</param>
        /// <param name="representationMapList">List of representations.</param>
        /// <param name="elemId">The element id label.</param>
        /// <param name="typeName">The IFCPlacementSetter.</param>
        /// <param name="instance">The family instance.</param>
        /// <param name="symbol">The element type.</param>
        /// <returns>The handle.</returns>
        public static IFCAnyHandle ExportGenericType(ExporterIFC exporterIFC,
           IFCExportType type,
           string ifcEnumType,
           string guid,
           string name,
           string description,
           string applicableOccurrence,
           HashSet<IFCAnyHandle> propertySets,
           IList<IFCAnyHandle> representationMapList,
           string elemId,
           string typeName,
           Element instance,
           ElementType symbol)
        {
            IFCFile file = exporterIFC.GetFile();
            IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();

            string elemIdToUse = elemId;
            string instanceElementType = null;
            switch (type)
            {
                case IFCExportType.ExportFurnitureType:
                case IFCExportType.ExportMemberType:
                case IFCExportType.ExportPlateType:
                    {
                        elemIdToUse = NamingUtil.GetTagOverride(instance, NamingUtil.CreateIFCElementId(instance));
                        instanceElementType = NamingUtil.GetOverrideStringValue(instance, "IfcElementType", typeName);
                        break;
                    }
            }
            
            
            IFCAnyHandle typeHandle = ExportGenericTypeBase(file, type, ifcEnumType, guid, ownerHistory, name, description, applicableOccurrence,
               null, representationMapList, elemIdToUse, instanceElementType, instance, symbol);
            
            return typeHandle;

        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:59,代码来源:FamilyExporterUtil.cs


示例9: IsEnergyConversionDeviceSubType

 /// <summary>
 /// Checks if export type is conversion device.
 /// </summary>
 /// <param name="exportType">
 /// The export type.
 /// </param>
 /// <returns>
 /// True if it is conversion device, false otherwise.
 /// </returns>
 public static bool IsEnergyConversionDeviceSubType(IFCExportType exportType)
 {
     // Note: Implementer's agreement #CV-2x3-166 changes IfcSpaceHeaterType from IfcEnergyConversionDevice to IfcFlowTerminal.
     return (exportType >= IFCExportType.ExportAirToAirHeatRecoveryType &&
        exportType <= IFCExportType.ExportUnitaryEquipmentType) && (exportType != IFCExportType.ExportSpaceHeaterType);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:15,代码来源:FamilyExporterUtil.cs


示例10: IsFlowTerminalSubType

 /// <summary>
 /// Checks if export type is flow terminal.
 /// </summary>
 /// <param name="exportType">
 /// The export type.
 /// </param>
 /// <returns>
 /// True if it is flow terminal, false otherwise.
 /// </returns>
 public static bool IsFlowTerminalSubType(IFCExportType exportType)
 {
     // Note: Implementer's agreement #CV-2x3-166 changes IfcSpaceHeaterType from IfcEnergyConversionDevice to IfcFlowTerminal.
     return (exportType >= IFCExportType.ExportAirTerminalType &&
        exportType <= IFCExportType.ExportWasteTerminalType) || (exportType == IFCExportType.ExportSpaceHeaterType);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:15,代码来源:FamilyExporterUtil.cs


示例11: ExportGenericInstance

        /// <summary>
        /// Exports a generic family instance as IFC instance.
        /// </summary>
        /// <param name="type">The export type.</param>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="familyInstance">The element.</param>
        /// <param name="wrapper">The ProductWrapper.</param>
        /// <param name="setter">The IFCPlacementSetter.</param>
        /// <param name="extraParams">The extrusion creation data.</param>
        /// <param name="instanceGUID">The guid.</param>
        /// <param name="ownerHistory">The owner history handle.</param>
        /// <param name="instanceName">The name.</param>
        /// <param name="instanceDescription">The description.</param>
        /// <param name="instanceObjectType">The object type.</param>
        /// <param name="productRepresentation">The representation handle.</param>
        /// <param name="instanceElemId">The element id label.</param>
        /// <returns>The handle.</returns>
        public static IFCAnyHandle ExportGenericInstance(IFCExportType type,
           ExporterIFC exporterIFC, Element familyInstance,
           ProductWrapper wrapper, IFCPlacementSetter setter, IFCExtrusionCreationData extraParams,
           string instanceGUID, IFCAnyHandle ownerHistory,
           string instanceName, string instanceDescription, string instanceObjectType,
           IFCAnyHandle productRepresentation,
           string instanceTag, IFCAnyHandle overrideLocalPlacement)
        {
            IFCFile file = exporterIFC.GetFile();
            Document doc = familyInstance.Document;

            bool isRoomRelated = IsRoomRelated(type);
            bool isChildInContainer = familyInstance.AssemblyInstanceId != ElementId.InvalidElementId;

            IFCAnyHandle localPlacementToUse = setter.GetPlacement();
            ElementId roomId = ElementId.InvalidElementId;
            if (isRoomRelated)
            {
                roomId = setter.UpdateRoomRelativeCoordinates(familyInstance, out localPlacementToUse);
            }

            //should remove the create method where there is no use of this handle for API methods
            //some places uses the return value of ExportGenericInstance as input parameter for API methods
            IFCAnyHandle instanceHandle = null;
            switch (type)
            {
                case IFCExportType.ExportColumnType:
                    {
                        instanceHandle = IFCInstanceExporter.CreateColumn(file, instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag);
                        break;
                    }
                case IFCExportType.ExportMemberType:
                    {
                        instanceHandle = IFCInstanceExporter.CreateMember(file, instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag);

                        // Register the members's IFC handle for later use by truss export.
                        ExporterCacheManager.ElementToHandleCache.Register(familyInstance.Id, instanceHandle);

                        break;
                    }
                case IFCExportType.ExportPlateType:
                    {
                        IFCAnyHandle localPlacement = localPlacementToUse;
                        if (overrideLocalPlacement!= null)
                        {
                            isChildInContainer = true;
                            localPlacement = overrideLocalPlacement;
                        }

                        instanceHandle = IFCInstanceExporter.CreatePlate(file, instanceGUID, ownerHistory,
                            instanceName, instanceDescription, instanceObjectType, localPlacement, productRepresentation, instanceTag);
                        break;
                    }
                case IFCExportType.ExportDiscreteAccessoryType:
                    {
                        instanceHandle = IFCInstanceExporter.CreateDiscreteAccessory(file, instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag);
                        break;
                    }
                case IFCExportType.ExportDistributionControlElement:
                    {
                        instanceHandle = IFCInstanceExporter.CreateDistributionControlElement(file, instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag,
                           null);
                        break;
                    }
                case IFCExportType.ExportDistributionElement:
                    {
                        instanceHandle = IFCInstanceExporter.CreateDistributionElement(file, instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag);
                        break;
                    }
                case IFCExportType.ExportFastenerType:
                    {
                        instanceHandle = IFCInstanceExporter.CreateFastener(file, instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag);
                        break;
                    }
                case IFCExportType.ExportMechanicalFastenerType:
                    {
                        double? nominalDiameter = null;
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:RevitIFC,代码行数:101,代码来源:FamilyExporterUtil.cs


示例12: Export

        /// <summary>
        /// Exports a MEP family instance.
        /// </summary>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="element">The element.</param>
        /// <param name="geometryElement">The geometry element.</param>
        /// <param name="exportType">The export type of the element.
        /// <param name="ifcEnumType">The sub-type of the element.</param></param>
        /// <param name="productWrapper">The ProductWrapper.</param>
        /// <returns>True if an entity was created, false otherwise.</returns>
        public static bool Export(ExporterIFC exporterIFC, Element element, GeometryElement geometryElement, 
            IFCExportType exportType, string ifcEnumType, ProductWrapper productWrapper)
        {
            IFCFile file = exporterIFC.GetFile();
            using (IFCTransaction tr = new IFCTransaction(file))
            {
                using (PlacementSetter setter = PlacementSetter.Create(exporterIFC, element))
                {
                    IFCAnyHandle localPlacementToUse = setter.LocalPlacement;
                    using (IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData())
                    {
                        extraParams.SetLocalPlacement(localPlacementToUse);

                        ElementId catId = CategoryUtil.GetSafeCategoryId(element);

                        BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
                        BodyData bodyData = null;
                        IFCAnyHandle productRepresentation = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC,
                            element, catId, geometryElement, bodyExporterOptions, null, extraParams, out bodyData);
                        if (IFCAnyHandleUtil.IsNullOrHasNoValue(productRepresentation))
                        {
                            extraParams.ClearOpenings();
                            return false;
                        }

                        IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
                        ElementId typeId = element.GetTypeId();
                        ElementType type = element.Document.GetElement(typeId) as ElementType;
                        FamilyTypeInfo currentTypeInfo = ExporterCacheManager.TypeObjectsCache.Find(typeId, false);

                        bool found = currentTypeInfo.IsValid();
                        if (!found)
                        {
                            string typeGUID = GUIDUtil.CreateGUID(type);
                            string typeName = NamingUtil.GetNameOverride(type, NamingUtil.GetIFCName(type));
                            string typeObjectType = NamingUtil.GetObjectTypeOverride(type, NamingUtil.CreateIFCObjectName(exporterIFC, type));
                            string applicableOccurence = NamingUtil.GetOverrideStringValue(type, "IfcApplicableOccurrence", typeObjectType);
                            string typeDescription = NamingUtil.GetDescriptionOverride(type, null);
                            string typeTag = NamingUtil.GetTagOverride(type, NamingUtil.CreateIFCElementId(type));
                            string typeElementType = NamingUtil.GetOverrideStringValue(type, "IfcElementType", typeName);

                            IList<IFCAnyHandle> repMapListOpt = new List<IFCAnyHandle>();

                            IFCAnyHandle styleHandle = FamilyExporterUtil.ExportGenericType(exporterIFC, exportType, ifcEnumType, typeGUID, typeName,
                               typeDescription, applicableOccurence, null, repMapListOpt, typeTag, typeElementType, element, type);
                            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(styleHandle))
                            {
                                productWrapper.RegisterHandleWithElementType(type, styleHandle, null);

                                currentTypeInfo.Style = styleHandle;
                                ExporterCacheManager.TypeObjectsCache.Register(typeId, false, currentTypeInfo);
                            }
                        }
                        string instanceGUID = GUIDUtil.CreateGUID(element);
                        string instanceName = NamingUtil.GetNameOverride(element, NamingUtil.GetIFCName(element));
                        string instanceObjectType = NamingUtil.GetObjectTypeOverride(element, NamingUtil.CreateIFCObjectName(exporterIFC, element));
                        string instanceDescription = NamingUtil.GetDescriptionOverride(element, null);
                        string instanceTag = NamingUtil.GetTagOverride(element, NamingUtil.CreateIFCElementId(element));

                        bool roomRelated = !FamilyExporterUtil.IsDistributionFlowElementSubType(exportType);

                        ElementId roomId = ElementId.InvalidElementId;
                        if (roomRelated)
                        {
                            roomId = setter.UpdateRoomRelativeCoordinates(element, out localPlacementToUse);
                        }

                        IFCAnyHandle instanceHandle = null;

                        // For MEP objects
                        string exportEntityStr = exportType.ToString();
                        Common.Enums.IFCEntityType exportEntity;

                        if (String.Compare(exportEntityStr.Substring(exportEntityStr.Length - 4), "Type", true) == 0)
                            exportEntityStr = exportEntityStr.Substring(0, (exportEntityStr.Length - 4));
                        if (Enum.TryParse(exportEntityStr, out exportEntity))
                        {
                            // For MEP object creation
                            instanceHandle = IFCInstanceExporter.CreateGenericIFCEntity(exportEntity, file, instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceTag);
                        }


                        if (IFCAnyHandleUtil.IsNullOrHasNoValue(instanceHandle))
                            return false;

                        bool relatedToSpace = (roomId != ElementId.InvalidElementId);
                        productWrapper.AddElement(element, instanceHandle, setter, extraParams, !relatedToSpace);
                        if (relatedToSpace)
                            ExporterCacheManager.SpaceInfoCache.RelateToSpace(roomId, instanceHandle);
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:RevitIFC,代码行数:101,代码来源:GenericMEPExporter.cs


示例13: ExportFamilyInstanceAsStandardElement

        /// <summary>
        /// Exports a family instance as standard element.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="element">
        /// The element to be exported.
        /// </param>
        /// <param name="geometryElement">
        /// The geometry element.
        /// </param>
        /// <param name="familyType">
        /// The export type.
        /// </param>
        /// <param name="ifcEnumTypeString">
        /// The string value represents the IFC type.
        /// </param>
        /// <param name="productWrapper">
        /// The IFCProductWrapper.
        /// </param>
        public static bool ExportFamilyInstanceAsStandardElement(IFCExportType familyType)
        {
            switch (familyType)
            {
                // These entities don't get exported as a mapped instance.  As such, we export them using
                // the standard methods.

                // standard building elements
                case IFCExportType.ExportBeam:
                case IFCExportType.ExportCovering:
                case IFCExportType.ExportFooting:
                case IFCExportType.ExportRailing:
                case IFCExportType.ExportRamp:
                case IFCExportType.ExportRoof:
                case IFCExportType.ExportSlab:
                case IFCExportType.ExportStair:
                case IFCExportType.ExportWall:
                // distribution elements
                case IFCExportType.ExportDistributionElement:
                case IFCExportType.ExportDistributionControlElement:
                case IFCExportType.ExportDistributionFlowElement:
                case IFCExportType.ExportEnergyConversionDevice:
                case IFCExportType.ExportFlowFitting:
                case IFCExportType.ExportFlowMovingDevice:
                case IFCExportType.ExportFlowSegment:
                case IFCExportType.ExportFlowStorageDevice:
                case IFCExportType.ExportFlowTerminal:
                case IFCExportType.ExportFlowTreatmentDevice:
                case IFCExportType.ExportFlowController:
                // furniture elements
                case IFCExportType.ExportFurnishingElement:
                    return true;
                default:
                    return false;
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:57,代码来源:FamilyInstanceExporter.cs


示例14: ExportFamilyInstanceAsMappedItem

        /// <summary>
        /// Exports a family instance as a mapped item.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="familyInstance">
        /// The family instance to be exported.
        /// </param>
        /// <param name="exportType">
        /// The export type.
        /// </param>
        /// <param name="ifcEnumType">
        /// The string value represents the IFC type.
        /// </param>
        /// <param name="wrapper">
        /// The IFCProductWrapper.
        /// </param>
        /// <param name="overrideLevelId">
        /// The level id.
        /// </param>
        /// <param name="range">
        /// The range of this family instance to be exported.
        /// </param>
        public static void ExportFamilyInstanceAsMappedItem(ExporterIFC exporterIFC,
           FamilyInstance familyInstance, IFCExportType exportType, string ifcEnumType,
           IFCProductWrapper wrapper, ElementId overrideLevelId, UV range)
        {
            Document doc = familyInstance.Document;
            IFCFile file = exporterIFC.GetFile();

            FamilySymbol familySymbol = ExporterIFCUtils.GetOriginalSymbol(familyInstance);
            if (familySymbol == null)
                return;

            IFCProductWrapper familyProductWrapper = IFCProductWrapper.Create(wrapper);
            double scale = exporterIFC.LinearScale;

            IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();

            HostObject hostElement = familyInstance.Host as HostObject; //hostElement could be null
            ElementId categoryId = CategoryUtil.GetSafeCategoryId(familySymbol);

            //string emptyString = "";
            string familyName = familySymbol.Name;
            IFCLabel objectType = IFCLabel.Create(familyName);

            // A Family Instance can have its own copy of geometry, or use the symbol's copy with a transform.
            // The routine below tells us whether to use the Instance's copy or the Symbol's copy.
            bool useInstanceGeometry = ExporterIFCUtils.UsesInstanceGeometry(familyInstance);

            IList<IFCExtrusionData> cutPairOpeningsForColumns = new List<IFCExtrusionData>();
            IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData();

            Transform trf = familyInstance.GetTransform();

            // Extra information if we are exporting a door or a window.
            IFCDoorWindowInfo doorWindowInfo = null;
            if (exportType == IFCExportType.ExportDoorType)
                doorWindowInfo = IFCDoorWindowInfo.CreateDoorInfo(exporterIFC, familyInstance, familySymbol, hostElement, overrideLevelId, trf);
            else if (exportType == IFCExportType.ExportWindowType)
                doorWindowInfo = IFCDoorWindowInfo.CreateWindowInfo(exporterIFC, familyInstance, familySymbol, hostElement, overrideLevelId, trf);

            IFCTypeInfo typeInfo = new IFCTypeInfo();
            XYZ extraOffset = XYZ.Zero;

            bool flipped = doorWindowInfo != null ? doorWindowInfo.IsSymbolFlipped : false;
            IFCTypeInfo currentTypeInfo = exporterIFC.FindType(familySymbol.Id, flipped);
            bool found = currentTypeInfo.IsValid();

            Family family = familySymbol.Family;

            // TODO: this code to be removed by ExtrusionAnalyzer code.
            bool trySpecialColumnCreation = ((exportType == IFCExportType.ExportColumnType) && (!family.IsInPlace));

            // We will create a new mapped type if:
            // 1.  We are exporting part of a column or in-place wall (range != null), OR
            // 2.  We are using the instance's copy of the geometry (that it, it has unique geometry), OR
            // 3.  We haven't already created the type.
            bool creatingType = ((range != null) || useInstanceGeometry || !found);
            if (creatingType)
            {
                IFCAnyHandle bodyRepresentation = IFCAnyHandle.Create();
                IFCAnyHandle planRepresentation = IFCAnyHandle.Create();

                // If we are using the instance geometry, ignore the transformation.
                if (useInstanceGeometry)
                    trf = Transform.Identity;

                // TODO: this code to be removed by ExtrusionAnalyzer code.
                if (trySpecialColumnCreation)
                {
                    XYZ rangeOffset = trf.Origin;
                    IFCFamilyInstanceExtrusionExportResults results;
                    if (range != null)
                    {
                        results = ExporterIFCUtils.ExportFamilyInstanceAsExtrusion(exporterIFC, familyInstance, useInstanceGeometry, range, overrideLevelId, extraParams);
                    }
                    else
                    {
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:101,代码来源:FamilyInstanceExporter.cs


示例15: ExportGenericInstance

        /// <summary>
        /// Exports a generic family instance as IFC instance.
        /// </summary>
        /// <param name="type">The export type.</param>
        /// <param name="exporterIFC">The ExporterIFC object.</param>
        /// <param name="familyInstance">The element.</param>
        /// <param name="wrapper">The IFCProductWrapper.</param>
        /// <param name="setter">The IFCPlacementSetter.</param>
        /// <param name="extraParams">The extrusion creation data.</param>
        /// <param name="instanceGUID">The guid.</param>
        /// <param name="ownerHistory">The owner history handle.</param>
        /// <param name="instanceName">The name.</param>
        /// <param name="instanceDescription">The description.</param>
        /// <param name="instanceObjectType">The object type.</param>
        /// <param name="productRepresentation">The representation handle.</param>
        /// <param name="instanceElemId">The element id label.</param>
        /// <returns>The handle.</returns>
        public static IFCAnyHandle ExportGenericInstance(IFCExportType type,
           ExporterIFC exporterIFC, Element familyInstance,
           IFCProductWrapper wrapper, IFCPlacementSetter setter, IFCExtrusionCreationData extraParams,
           IFCLabel instanceGUID, IFCAnyHandle ownerHistory,
           IFCLabel instanceName, IFCLabel instanceDescription, IFCLabel instanceObjectType,
           IFCAnyHandle productRepresentation,
           IFCLabel instanceElemId)
        {
            IFCFile file = exporterIFC.GetFile();
            Document doc = familyInstance.Document;

            bool isRoomRelated = IsRoomRelated(type);

            IFCAnyHandle localPlacementToUse = setter.GetPlacement();
            ElementId roomId = ElementId.InvalidElementId;
            if (isRoomRelated)
            {
                roomId = setter.UpdateRoomRelativeCoordinates(familyInstance, out localPlacementToUse);
            }

            IFCAnyHandle instanceHandle = IFCAnyHandle.Create();
            switch (type)
            {
                case IFCExportType.ExportColumnType:
                    {
                        instanceHandle = file.CreateColumn(instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        break;
                    }
                case IFCExportType.ExportMemberType:
                    {
                        instanceHandle = file.CreateMember(instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        break;
                    }
                case IFCExportType.ExportPlateType:
                    {
                        instanceHandle = file.CreatePlate(instanceGUID, ownerHistory,
                           instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        break;
                    }
                default:
                    {
                        if (IsFurnishingElementSubType(type))
                        {
                            instanceHandle = file.CreateFurnishingElement(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsDistributionFlowElementSubType(type))
                        {
                            instanceHandle = file.CreateDistributionFlowElement(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsEnergyConversionDeviceSubType(type))
                        {
                            instanceHandle = file.CreateEnergyConversionDevice(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsFlowFittingSubType(type))
                        {
                            instanceHandle = file.CreateFlowFitting(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsFlowMovingDeviceSubType(type))
                        {
                            instanceHandle = file.CreateFlowMovingDevice(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsFlowSegmentSubType(type))
                        {
                            instanceHandle = file.CreateFlowSegment(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsFlowStorageDeviceSubType(type))
                        {
                            instanceHandle = file.CreateFlowStorageDevice(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
                        else if (IsFlowTerminalSubType(type))
                        {
                            instanceHandle = file.CreateFlowTerminal(instanceGUID, ownerHistory,
                               instanceName, instanceDescription, instanceObjectType, localPlacementToUse, productRepresentation, instanceElemId);
                        }
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:101,代码来源:FamilyExporterUtil.cs


示例16: ProxyForMEPType

        /// <summary>
        /// Check if an element assigned to IfcBuildingElementProxy is of MEP Type (by checking its connectors) to enable IfcBuildingElementProxy to take part
        /// in the System component and connectivity
        /// </summary>
        /// <param name="element">The element</param>
        /// <param name="exportType">IFC Export Type to check: only for IfcBuildingElementProxy or IfcBuildingElementProxyType</param>
        /// <returns></returns>
        public static bool ProxyForMEPType(Element element, IFCExportType exportType)
        {
            if ((exportType == IFCExportType.IfcBuildingElementProxy) || (exportType == IFCExportType.IfcBuildingElementProxyType))
            {
                try
                {
                    if (element is FamilyInstance)
                    {
                        MEPModel m = ((FamilyInstance)element).MEPModel;
                        if (m != null && m.ConnectorManager != null)
                        {
                            return true;
                        }
                    }
                    else
                        return false;
                }
                catch
                {
                }
            }

            return false;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:31,代码来源:ElementFilteringUtil.cs


示例17: ExportGenericType

该文章已有0人参与评论

请发表评论

全部评论

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