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

C# IFCFile类代码示例

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

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



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

示例1: CreateElectricalCurrentMeasurePropertyFromCache

        /// <summary>
        /// Create a label property, or retrieve from cache.
        /// </summary>
        /// <param name="file">The IFC file.</param>
        /// <param name="propertyName">The name of the property.</param>
        /// <param name="value">The value of the property.</param>
        /// <param name="valueType">The value type of the property.</param>
        /// <returns>The created or cached property handle.</returns>
        public static IFCAnyHandle CreateElectricalCurrentMeasurePropertyFromCache(IFCFile file, string propertyName, double value, PropertyValueType valueType)
        {
            // We have a partial cache here - we will only cache multiples of 15 degrees.
            bool canCache = false;
            double ampsDiv5 = Math.Floor(value / 5.0 + 0.5);
            double integerAmps = ampsDiv5 * 5.0;
            if (MathUtil.IsAlmostEqual(value, integerAmps))
            {
                canCache = true;
                value = integerAmps;
            }

            IFCAnyHandle propertyHandle;
            if (canCache)
            {
                propertyHandle = ExporterCacheManager.PropertyInfoCache.ElectricalCurrentCache.Find(propertyName, value);
                if (propertyHandle != null)
                    return propertyHandle;
            }

            propertyHandle = CreateElectricalCurrentMeasureProperty(file, propertyName, value, valueType);

            if (canCache && !IFCAnyHandleUtil.IsNullOrHasNoValue(propertyHandle))
            {
                ExporterCacheManager.PropertyInfoCache.ElectricalCurrentCache.Add(propertyName, value, propertyHandle);
            }

            return propertyHandle;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:37,代码来源:ElectricalCurrentPropertyUtil.cs


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


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


示例4: CreateAxis

        /// <summary>
        /// Creates IfcAxis2Placement3D object.
        /// </summary>
        /// <param name="file">
        /// The IFC file.
        /// </param>
        /// <param name="origin">
        /// The origin.
        /// </param>
        /// <param name="zDirection">
        /// The Z direction.
        /// </param>
        /// <param name="xDirection">
        /// The X direction.
        /// </param>
        /// <returns>
        /// The handle.
        /// </returns>
        public static IFCAnyHandle CreateAxis(IFCFile file, XYZ origin, XYZ zDirection, XYZ xDirection)
        {
            IFCAnyHandle directionOpt = IFCAnyHandle.Create();
            IFCAnyHandle refOpt = IFCAnyHandle.Create();
            IFCAnyHandle location = IFCAnyHandle.Create();

            if (origin != null)
            {
                IList<double> measure = new List<double>();
                measure.Add(origin.X); measure.Add(origin.Y); measure.Add(origin.Z);
                location = CreateCartesianPoint(file, measure);
            }
            else
            {
                location = ExporterIFCUtils.GetGlobal3DOriginHandle();
            }

            bool exportzDirectionAndxDirection = (zDirection != null && xDirection != null && (!MathUtil.IsAlmostEqual(zDirection[2], 1.0) || !MathUtil.IsAlmostEqual(xDirection[0], 1.0)));

            if (exportzDirectionAndxDirection)
            {
                IList<double> axisPts = new List<double>();
                axisPts.Add(zDirection.X); axisPts.Add(zDirection.Y); axisPts.Add(zDirection.Z);
                directionOpt = CreateDirection(file, axisPts);
            }

            if (exportzDirectionAndxDirection)
            {
                IList<double> axisPts = new List<double>();
                axisPts.Add(xDirection.X); axisPts.Add(xDirection.Y); axisPts.Add(xDirection.Z);
                refOpt = CreateDirection(file, axisPts);
            }

            return file.CreateAxis2Placement3D(location, directionOpt, refOpt);
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:53,代码来源:ExporterUtil.cs


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


示例6: CreateClassification

        /// <summary>
        /// 
        /// </summary>
        /// <param name="exporterIFC"></param>
        /// <param name="file"></param>
        /// <param name="element"></param>
        /// <param name="elemHnd"></param>
        /// <param name="location"></param>
        public static void CreateClassification(ExporterIFC exporterIFC, IFCFile file, Element element, IFCAnyHandle elemHnd, string location)
        {
            string paramClassificationCode = "";
            string classificationName = null;
            string classificationCode = null;
            string classificationDescription = null;
            // For now the support is fixed to 10 predefined classification code parameter names (to support limitation of schedule key that supports only one category per schedule key and needs one parameter for each)
            int noClassCodeParam = 10;
            string [] classCodeParamName = {"ClassificationCode", "ClassificationCode(2)", "ClassificationCode(3)", "ClassificationCode(4)", "ClassificationCode(5)",
                                           "ClassificationCode(6)", "ClassificationCode(7)", "ClassificationCode(8)", "ClassificationCode(9)", "ClassificationCode(10)"}; 
            int ret = 0;

            for (int n = 0; n < noClassCodeParam; n++)
            {
                // Create A classification, if it is not set.
                if (ParameterUtil.GetStringValueFromElementOrSymbol(element, classCodeParamName[n], out paramClassificationCode))
                {
                    ret = parseClassificationCode(paramClassificationCode, out classificationName, out classificationCode, out classificationDescription);

                    if (string.IsNullOrEmpty(classificationName))
                        classificationName = "Default Classification";

                    IFCAnyHandle classification;
                    if (!ExporterCacheManager.ClassificationCache.TryGetValue(classificationName, out classification))
                    {
                        IFCClassificationMgr savedClassificationFromUI = new IFCClassificationMgr();
                        IFCClassification savedClassification = new IFCClassification();

                        if (savedClassificationFromUI.GetSavedClassificationByName(element.Document, classificationName, out savedClassification))
                        {
                            if (savedClassification.ClassificationEditionDate == null)
                            {
                                IFCAnyHandle editionDate = IFCInstanceExporter.CreateCalendarDate(file, savedClassification.ClassificationEditionDate.Day, savedClassification.ClassificationEditionDate.Month, savedClassification.ClassificationEditionDate.Year);

                                classification = IFCInstanceExporter.CreateClassification(file, savedClassification.ClassificationSource, savedClassification.ClassificationEdition,
                                    editionDate, savedClassification.ClassificationName);
                            }
                            else
                                classification = IFCInstanceExporter.CreateClassification(file, savedClassification.ClassificationSource, savedClassification.ClassificationEdition,
                                    null, savedClassification.ClassificationName);
                        }
                        else
                            classification = IFCInstanceExporter.CreateClassification(file, "", "", null, classificationName);

                        ExporterCacheManager.ClassificationCache.Add(classificationName, classification);
                        if (!String.IsNullOrEmpty(savedClassification.ClassificationLocation))
                            ExporterCacheManager.ClassificationLocationCache.Add(classificationName, savedClassification.ClassificationLocation);
                    }

                    if (String.IsNullOrEmpty(location))
                    {
                        ExporterCacheManager.ClassificationLocationCache.TryGetValue(classificationName, out location);
                    }
                    InsertClassificationReference(exporterIFC, file, element, elemHnd, classificationName, classificationCode, classificationDescription, location);
                }
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:65,代码来源:ClassificationUtil.cs


示例7: CreateActor

        /// <summary>
        /// Creates a handle representing an IfcActor and assigns it to the file.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <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>
        /// <param name="objectType">The object type.</param>
        /// <param name="theActor">The actor.</param>
        /// <returns>The handle.</returns>
        public static IFCAnyHandle CreateActor(IFCFile file, string guid, IFCAnyHandle ownerHistory,
            string name, string description, string objectType, IFCAnyHandle theActor)
        {
            ValidateActor(guid, ownerHistory, name, description, objectType, theActor);

            IFCAnyHandle actorHandle = CreateInstance(file, IFCEntityType.IfcActor);
            SetActor(actorHandle, guid, ownerHistory, name, description, objectType, theActor);
            return actorHandle;
        }
开发者ID:stiter,项目名称:ifcexporter,代码行数:20,代码来源:IFCInstanceExporter.cs


示例8: ProcessEntries

 /// <summary>
 /// Creates handles for the quantities.
 /// </summary>
 /// <param name="file">The IFC file.</param>
 /// <param name="exporterIFC">The ExporterIFC class.</param>
 /// <param name="ifcParams">The extrusion creation data, used to get extra parameter information.</param>
 /// <param name="elementToUse">The base element.</param>
 /// <param name="elemTypeToUse">The base element type.</param>
 /// <returns>A set of quantities handles.</returns>
 public HashSet<IFCAnyHandle> ProcessEntries(IFCFile file, ExporterIFC exporterIFC, IFCExtrusionCreationData ifcParams, Element elementToUse, ElementType elemTypeToUse)
 {
     HashSet<IFCAnyHandle> props = new HashSet<IFCAnyHandle>();
     foreach (QuantityEntry entry in m_Entries)
     {
         IFCAnyHandle propHnd = entry.ProcessEntry(file, exporterIFC, ifcParams, elementToUse, elemTypeToUse);
         if (!IFCAnyHandleUtil.IsNullOrHasNoValue(propHnd))
             props.Add(propHnd);
     }
     return props;
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:20,代码来源:QuantityDescription.cs


示例9: CreateActuatorType

        /// <summary>
        /// Creates an IfcActuatorType, and assigns it to the file.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <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>
        /// <param name="applicableOccurrence">The attribute optionally defines the data type of the occurrence object.</param>
        /// <param name="propertySets">The property set(s) associated with the type.</param>
        /// <param name="representationMaps">The mapped geometries associated with the type.</param>
        /// <param name="elementTag">The tag that represents the entity.</param>
        /// <param name="elementType">The type name.</param>
        /// <param name="predefinedType">The predefined types.</param>
        /// <returns>The handle.</returns>
        public static IFCAnyHandle CreateActuatorType(IFCFile file, string guid, IFCAnyHandle ownerHistory, string name,
            string description, string applicableOccurrence, HashSet<IFCAnyHandle> propertySets,
            IList<IFCAnyHandle> representationMaps, string elementTag, string elementType, IFCActuatorType predefinedType)
        {
            ValidateElementType(guid, ownerHistory, name, description, applicableOccurrence, propertySets,
                representationMaps, elementTag, elementType);

            IFCAnyHandle actuatorType = CreateInstance(file, IFCEntityType.IfcActuatorType);
            IFCAnyHandleUtil.SetAttribute(actuatorType, "PredefinedType", predefinedType);
            SetElementType(actuatorType, guid, ownerHistory, name, description, applicableOccurrence, propertySets,
                representationMaps, elementTag, elementType);
            return actuatorType;
        }
开发者ID:stiter,项目名称:ifcexporter,代码行数:28,代码来源:IFCInstanceExporter.cs


示例10: CreateElectricalCurrentMeasureProperty

 /// <summary>
 /// Create a label property.
 /// </summary>
 /// <param name="file">The IFC file.</param>
 /// <param name="propertyName">The name of the property.</param>
 /// <param name="value">The value of the property.</param>
 /// <param name="valueType">The value type of the property.</param>
 /// <returns>The created property handle.</returns>
 public static IFCAnyHandle CreateElectricalCurrentMeasureProperty(IFCFile file, string propertyName, double value, PropertyValueType valueType)
 {
     switch (valueType)
     {
         case PropertyValueType.EnumeratedValue:
             {
                 IList<IFCData> valueList = new List<IFCData>();
                 valueList.Add(IFCDataUtil.CreateAsElectricalCurrentMeasure(value));
                 return IFCInstanceExporter.CreatePropertyEnumeratedValue(file, propertyName, null, valueList, null);
             }
         case PropertyValueType.SingleValue:
             return IFCInstanceExporter.CreatePropertySingleValue(file, propertyName, null, IFCDataUtil.CreateAsElectricalCurrentMeasure(value), null);
         default:
             throw new InvalidOperationException("Missing case!");
     }
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:24,代码来源:ElectricalCurrentPropertyUtil.cs


示例11: CreateSweptDiskSolid

        private static IFCAnyHandle CreateSweptDiskSolid(ExporterIFC exporterIFC, IFCFile file, Curve centerCurve, double radius)
        {
            IList<Curve> curves = new List<Curve>();
            double endParam = 0.0;
            if (centerCurve is Arc || centerCurve is Ellipse)
            {
                if (centerCurve.IsBound)
                    endParam = (centerCurve.get_EndParameter(1) - centerCurve.get_EndParameter(0)) * 180 / Math.PI;
                else
                    endParam = (2 * Math.PI) * 180 / Math.PI;
            }
            else
                endParam = 1.0;
            curves.Add(centerCurve);

            IFCAnyHandle compositeCurve = GeometryUtil.CreateCompositeCurve(exporterIFC, curves);
            return IFCInstanceExporter.CreateSweptDiskSolid(file, compositeCurve, radius, null, 0, endParam);
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:18,代码来源:FabricSheetExporter.cs


示例12: CreatePositivePlaneAngleMeasureProperty

        /// <summary>
        /// Create a label property.
        /// </summary>
        /// <param name="file">The IFC file.</param>
        /// <param name="propertyName">The name of the property.</param>
        /// <param name="value">The value of the property.</param>
        /// <param name="valueType">The value type of the property.</param>
        /// <returns>The created property handle.</returns>
        public static IFCAnyHandle CreatePositivePlaneAngleMeasureProperty(IFCFile file, string propertyName, double value, PropertyValueType valueType)
        {
            // Ensure it is positive.  Don't throw, but should tell user.
            if (value <= MathUtil.Eps())
                return null;

            switch (valueType)
            {
                case PropertyValueType.EnumeratedValue:
                    {
                        IList<IFCData> valueList = new List<IFCData>();
                        valueList.Add(IFCDataUtil.CreateAsPositivePlaneAngleMeasure(value));
                        return IFCInstanceExporter.CreatePropertyEnumeratedValue(file, propertyName, null, valueList, null);
                    }
                case PropertyValueType.SingleValue:
                    return IFCInstanceExporter.CreatePropertySingleValue(file, propertyName, null, IFCDataUtil.CreateAsPositivePlaneAngleMeasure(value), null);
                default:
                    throw new InvalidOperationException("Missing case!");
            }
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:28,代码来源:PositivePlaneAnglePropertyUtil.cs


示例13: CreateCommonProperty

 protected static IFCAnyHandle CreateCommonProperty(IFCFile file, string propertyName, IFCData valueData, PropertyValueType valueType, string unitTypeKey)
 {
     switch (valueType)
     {
         case PropertyValueType.EnumeratedValue:
             {
                 IList<IFCData> valueList = new List<IFCData>();
                 valueList.Add(valueData);
                 return IFCInstanceExporter.CreatePropertyEnumeratedValue(file, propertyName, null, valueList, null);
             }
         case PropertyValueType.SingleValue:
             {
                 if (unitTypeKey != null)
                     return IFCInstanceExporter.CreatePropertySingleValue(file, propertyName, null, valueData, ExporterCacheManager.UnitsCache[unitTypeKey]);
                 else
                     return IFCInstanceExporter.CreatePropertySingleValue(file, propertyName, null, valueData, null);
             }
         default:
             throw new InvalidOperationException("Missing case!");
     }
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:21,代码来源:PropertyUtil.cs


示例14: CreateFrequencyPropertyFromElementOrSymbol

        /// <summary>
        /// Create a Frequency measure property from the element's or type'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="revitBuiltInParam">The built in parameter to use, if revitParameterName isn't found.</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 CreateFrequencyPropertyFromElementOrSymbol(IFCFile file, ExporterIFC exporterIFC, Element elem,
            string revitParameterName, BuiltInParameter revitBuiltInParam, string ifcPropertyName, PropertyValueType valueType)
        {
            IFCAnyHandle propHnd = CreateFrequencyPropertyFromElement(file, exporterIFC, elem, revitParameterName, ifcPropertyName, valueType);
            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(propHnd))
                return propHnd;

            if (revitBuiltInParam != BuiltInParameter.INVALID)
            {
                string builtInParamName = LabelUtils.GetLabelFor(revitBuiltInParam);
                propHnd = CreateFrequencyPropertyFromElement(file, exporterIFC, elem, builtInParamName, ifcPropertyName, valueType);
                if (!IFCAnyHandleUtil.IsNullOrHasNoValue(propHnd))
                    return propHnd;
            }

            // For Symbol
            Document document = elem.Document;
            ElementId typeId = elem.GetTypeId();
            Element elemType = document.GetElement(typeId);
            if (elemType != null)
                return CreateFrequencyPropertyFromElementOrSymbol(file, exporterIFC, elemType, revitParameterName, revitBuiltInParam, ifcPropertyName, valueType);
            else
                return null;
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:35,代码来源:FrequencyPropertyUtil.cs


示例15: CreateDefaultMappedItem

 /// <summary>
 /// Creates IfcMappedItem object at (0,0,0).
 /// </summary>
 /// <param name="file">
 /// The IFC file.
 /// </param>
 /// <param name="repMap">
 /// The handle to be mapped.
 /// </param>
 /// <param name="orig">
 /// The orig for mapping transformation.
 /// </param>
 /// <returns>
 /// The handle.
 /// </returns>
 public static IFCAnyHandle CreateDefaultMappedItem(IFCFile file, IFCAnyHandle repMap)
 {
     IFCAnyHandle transformHnd = ExporterCacheManager.GetDefaultCartesianTransformationOperator3D(file);
     return IFCInstanceExporter.CreateMappedItem(file, repMap, transformHnd);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:20,代码来源:ExporterUtil.cs


示例16: CreateAxis2Placement3D

 /// <summary>
 /// Creates a default IfcAxis2Placement3D object.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <returns>The handle.</returns>
 public static IFCAnyHandle CreateAxis2Placement3D(IFCFile file)
 {
     return CreateAxis2Placement3D(file, null);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:9,代码来源:ExporterUtil.cs


示例17: CreateCartesianPoint

        /// <summary>
        /// Creates IfcCartesianPoint object.
        /// </summary>
        /// <param name="file">
        /// The IFC file.
        /// </param>
        /// <param name="measure">
        /// The list of doubles to create the Cartesian point.
        /// </param>
        /// <returns>
        /// The handle.
        /// </returns>
        public static IFCAnyHandle CreateCartesianPoint(IFCFile file, IList<double> measure)
        {
            IList<double> cleanMeasure = new List<double>();
            foreach (double value in measure)
            {
                double ceilMeasure = Math.Ceiling(value);
                double floorMeasure = Math.Floor(value);

                if (MathUtil.IsAlmostEqual(value, ceilMeasure))
                    cleanMeasure.Add(ceilMeasure);
                else if (MathUtil.IsAlmostEqual(value, floorMeasure))
                    cleanMeasure.Add(floorMeasure);
                else
                    cleanMeasure.Add(value);
            }

            if (MathUtil.IsAlmostZero(cleanMeasure[0]) && MathUtil.IsAlmostZero(cleanMeasure[1]))
            {
                if (measure.Count == 2)
                {
                    return ExporterIFCUtils.GetGlobal2DOriginHandle();
                }
                if (measure.Count == 3 && MathUtil.IsAlmostZero(cleanMeasure[2]))
                {
                    return ExporterIFCUtils.GetGlobal3DOriginHandle();
                }

            }

            IFCAnyHandle pointHandle = IFCInstanceExporter.CreateCartesianPoint(file, cleanMeasure);

            return pointHandle;
        }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:45,代码来源:ExporterUtil.cs


示例18: CreateDirection

 /// <summary>
 /// Creates IfcDirection object.
 /// </summary>
 /// <param name="file">
 /// The IFC file.
 /// </param>
 /// <param name="direction">
 /// The direction.
 /// </param>
 /// <returns>
 /// The handle.
 /// </returns>
 public static IFCAnyHandle CreateDirection(IFCFile file, XYZ direction)
 {
     IList<double> measure = new List<double>();
     measure.Add(direction.X);
     measure.Add(direction.Y);
     measure.Add(direction.Z);
     return CreateDirection(file, measure);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:20,代码来源:ExporterUtil.cs


示例19: CreateLocalPlacement

 /// <summary>
 /// Creates a new local placement object.
 /// </summary>
 /// <param name="file">The IFC file.</param>
 /// <param name="placementRelTo">The placement object.</param>
 /// <param name="location">The relative placement origin.</param>
 /// <param name="axis">The relative placement Z value.</param>
 /// <param name="refDirection">The relative placement X value.</param>
 /// <returns></returns>
 public static IFCAnyHandle CreateLocalPlacement(IFCFile file, IFCAnyHandle placementRelTo, XYZ location, XYZ axis, XYZ refDirection)
 {
     IFCAnyHandle relativePlacement = ExporterUtil.CreateAxis2Placement3D(file, location, axis, refDirection);
     return IFCInstanceExporter.CreateLocalPlacement(file, placementRelTo, relativePlacement);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:14,代码来源:ExporterUtil.cs


示例20: CopyLocalPlacement

 /// <summary>
 /// Creates a copy of local placement object.
 /// </summary>
 /// <param name="file">
 /// The IFC file.
 /// </param>
 /// <param name="originalPlacement">
 /// The original placement object to be copied.
 /// </param>
 /// <returns>
 /// The handle.
 /// </returns>
 public static IFCAnyHandle CopyLocalPlacement(IFCFile file, IFCAnyHandle originalPlacement)
 {
     IFCAnyHandle placementRelToOpt = GeometryUtil.GetPlacementRelToFromLocalPlacement(originalPlacement);
     IFCAnyHandle relativePlacement = GeometryUtil.GetRelativePlacementFromLocalPlacement(originalPlacement);
     return IFCInstanceExporter.CreateLocalPlacement(file, placementRelToOpt, relativePlacement);
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:18,代码来源:ExporterUtil.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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