当前位置: 首页>>代码示例>>C#>>正文


C# FamilyInstance.GetOrderedParameters方法代码示例

本文整理汇总了C#中FamilyInstance.GetOrderedParameters方法的典型用法代码示例。如果您正苦于以下问题:C# FamilyInstance.GetOrderedParameters方法的具体用法?C# FamilyInstance.GetOrderedParameters怎么用?C# FamilyInstance.GetOrderedParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FamilyInstance的用法示例。


在下文中一共展示了FamilyInstance.GetOrderedParameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetInstanceData

        /// <summary>
        /// Retrieve the family instance data to store in 
        /// the external database for the given component
        /// and return it as a dictionary-like object.
        /// Obsolete, replaced by InstanceData class.
        /// </summary>
        object GetInstanceData(
            FamilyInstance a,
            Transform geoTransform)
        {
            Document doc = a.Document;
              FamilySymbol symbol = a.Symbol;
              Category cat = a.Category;

              Debug.Assert( null != cat,
            "expected valid category" );

              string levelName = ElementId.InvalidElementId == a.LevelId
            ? "-1"
            : doc.GetElement( a.LevelId ).Name;

              XYZ location = Util.GetLocation( a );

              Debug.Assert( null != location,
            "expected valid location" );

              XYZ geolocation = geoTransform.OfPoint(
            location );

              string properties = Util.GetPropertiesJson(
            a.GetOrderedParameters() );

              // /a/src/web/CompHoundWeb/model/instance.js
              // _id         : UniqueId // suppress automatic generation
              // project    : String
              // path       : String
              // family     : String
              // symbol     : String
              // category   : String
              // level      : String
              // x          : Number
              // y          : Number
              // z          : Number
              // easting    : Number // Geo2d?
              // northing   : Number
              // properties : String // json dictionary of instance properties and values

              object data = new
              {
            _id = a.UniqueId,
            project = doc.Title,
            path = doc.PathName,
            family = symbol.FamilyName,
            symbol = symbol.Name,
            category = cat.Name,
            level = levelName,
            x = location.X,
            y = location.Y,
            z = location.Z,
            easting = geolocation.X,
            northing = geolocation.Y,
            properties = properties
              };

              return data;
        }
开发者ID:CompHound,项目名称:CompHoundRvt,代码行数:66,代码来源:Command.cs

示例2: GetComponentDataJson

        /// <summary>
        /// Retrieve the family instance data to store in 
        /// the external database for the given component
        /// and return it as a dictionary in a JSON 
        /// formatted string.
        /// Obsolete, replaced by GetInstanceData method.
        /// </summary>
        string GetComponentDataJson(
            FamilyInstance a,
            Transform geoTransform)
        {
            Document doc = a.Document;
              FamilySymbol symbol = a.Symbol;

              XYZ location = Util.GetLocation( a );

              XYZ geolocation = geoTransform.OfPoint(
            location );

              string properties = Util.GetPropertiesJson(
            a.GetOrderedParameters() );

              // /a/src/web/CompHoundWeb/model/instance.js
              // _id         : UniqueId // suppress automatic generation
              // project    : String
              // path       : String
              // family     : String
              // symbol     : String
              // level      : String
              // x          : Number
              // y          : Number
              // z          : Number
              // easting    : Number // Geo2d?
              // northing   : Number
              // properties : String // json dictionary of instance properties and values

              string s = string.Format(
            "\"_id\": \"{0}\", "
            + "\"project\": \"{1}\", "
            + "\"path\": \"{2}\", "
            + "\"family\": \"{3}\", "
            + "\"symbol\": \"{4}\", "
            + "\"level\": \"{5}\", "
            + "\"x\": \"{6}\", "
            + "\"y\": \"{7}\", "
            + "\"z\": \"{8}\", "
            + "\"easting\": \"{9}\", "
            + "\"northing\": \"{10}\", "
            + "\"properties\": \"{11}\"",
            a.UniqueId, doc.Title, doc.PathName,
            symbol.FamilyName, symbol.Name,
            doc.GetElement( a.LevelId ).Name,
            Util.RealString( location.X ),
            Util.RealString( location.Y ),
            Util.RealString( location.Z ),
            Util.RealString( geolocation.X ),
            Util.RealString( geolocation.Y ),
            properties );

              return "{" + s + "}";
        }
开发者ID:CompHound,项目名称:CompHoundRvt,代码行数:61,代码来源:Command.cs


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