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


C# Autodesk.get_Parameter方法代码示例

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


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

示例1: RoofItem

        /// <summary>
        /// The construct of the RoofItem class.
        /// </summary>
        /// <param name="roof"></param>
        public RoofItem(Autodesk.Revit.DB.RoofBase roof)
            : base(roof.Id.IntegerValue.ToString())
        {
            m_roof = roof;
            this.SubItems.Add(roof.Name);

            if (m_roof is Autodesk.Revit.DB.FootPrintRoof)
            {
                Parameter para = roof.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.ROOF_BASE_LEVEL_PARAM);
                this.SubItems.Add(LevelConverter.GetLevelByID(para.AsElementId().IntegerValue).Name);
            }
            else if (m_roof is Autodesk.Revit.DB.ExtrusionRoof)
            {
                Parameter para = roof.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM);
                this.SubItems.Add(LevelConverter.GetLevelByID(para.AsElementId().IntegerValue).Name);
            }

            this.SubItems.Add(roof.RoofType.Name);
        }
开发者ID:AMEE,项目名称:revit,代码行数:23,代码来源:RoofItem.cs

示例2: GetParameterTable

        /// <summary>
        /// get a datatable contains parameters'information of SpotDimension
        /// here, almost only get Type Parameters of SpotDimension
        /// </summary>
        /// <param name="spotDimension">the SpotDimension need to be dealt with</param>
        /// <returns>a DataTable store Parameter information</returns>
        public DataTable GetParameterTable(Autodesk.Revit.DB.SpotDimension spotDimension)
        {
            try
            {
                //check whether is null
                if (null == spotDimension)
                {
                    return null;
                }

                //create an empty datatable
                DataTable parameterTable = CreateTable();

                //get DimensionType
                Autodesk.Revit.DB.DimensionType dimensionType = spotDimension.DimensionType;

                //begin to get Parameters and add them to a DataTable
                Parameter temporaryParam = null;
                string temporaryValue = "";

                #region Get all SpotDimension element parameters

                //string formatter
                string formatter = "#0.000";

                //Property Category of SpotDimension
                AddDataRow("Category", spotDimension.Category.Name, parameterTable);

                //Leader Arrowhead
                temporaryParam =
                    dimensionType.get_Parameter(BuiltInParameter.SPOT_ELEV_LEADER_ARROWHEAD);
                Autodesk.Revit.DB.ElementId elementId = temporaryParam.AsElementId();
                //if not found that element, add string "None" to DataTable
                if (-1 == elementId.IntegerValue)
                {
                    temporaryValue = "None";
                }
                else
                {
                    temporaryValue = m_document.get_Element(elementId).Name;
                }
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //Leader Line Weight
                temporaryParam = dimensionType.get_Parameter(BuiltInParameter.SPOT_ELEV_LINE_PEN);
                temporaryValue = temporaryParam.AsInteger().ToString();
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //Leader Arrowhead Line Weight
                temporaryParam =
                    dimensionType.get_Parameter(BuiltInParameter.SPOT_ELEV_TICK_MARK_PEN);
                temporaryValue = temporaryParam.AsInteger().ToString();
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //Symbol
                temporaryParam = dimensionType.get_Parameter(BuiltInParameter.SPOT_ELEV_SYMBOL);
                elementId = temporaryParam.AsElementId();
                //if not found that element, add string "None" to DataTable
                if (-1 == elementId.IntegerValue)
                {
                    temporaryValue = "None";
                }
                else
                {
                    temporaryValue = m_document.get_Element(elementId).Name;
                }
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //Text Size
                temporaryParam = dimensionType.get_Parameter(BuiltInParameter.TEXT_SIZE);
                temporaryValue =
                    (temporaryParam.AsDouble() / ToFractionalInches).ToString(formatter) + "''";
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //Text Offset from Leader
                temporaryParam =
                    dimensionType.get_Parameter(BuiltInParameter.SPOT_TEXT_FROM_LEADER);
                temporaryValue =
                    (temporaryParam.AsDouble() / ToFractionalInches).ToString(formatter) + "''";
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //Text Offset from Symbol
                temporaryParam =
                    dimensionType.get_Parameter(BuiltInParameter.SPOT_ELEV_TEXT_HORIZ_OFFSET);
                temporaryValue =
                    (temporaryParam.AsDouble() / ToFractionalInches).ToString(formatter) + "''";
                AddDataRow(temporaryParam.Definition.Name, temporaryValue, parameterTable);

                //for Spot Coordinates, add some other Parameters
                if ("Spot Coordinates" == spotDimension.Category.Name)
                {
                    //Coordinate Origin
                    temporaryParam =
                        dimensionType.get_Parameter(BuiltInParameter.SPOT_COORDINATE_BASE);
//.........这里部分代码省略.........
开发者ID:AMEE,项目名称:revit,代码行数:101,代码来源:SpotDimensionParams.cs

示例3: FrameWall

    FrameWall( Autodesk.Revit.ApplicationServices.Application rvtApp, Autodesk.Revit.DB.Wall wall, double spacing, FamilySymbol columnType )
    {
      Document rvtDoc = wall.Document;

      LocationCurve loc = (LocationCurve) wall.Location;
      XYZ startPt = loc.Curve.GetEndPoint( 0 );
      XYZ endPt = loc.Curve.GetEndPoint( 1 );

      UV wallVec = new UV( endPt.X - startPt.X, endPt.Y - startPt.Y );

      UV axis = new UV( 1.0, 0.0 );


      ElementId baseLevelId = wall.get_Parameter( BuiltInParameter.WALL_BASE_CONSTRAINT ).AsElementId();
      ElementId topLevelId = wall.get_Parameter( BuiltInParameter.WALL_HEIGHT_TYPE ).AsElementId();

      double wallLength = VecLength( wallVec );
      wallVec = VecNormalise( wallVec );

      int nmax = (int) ( wallLength / spacing );

      MessageBox.Show( "Wall Length = " + wallLength + "\nSpacing = " + spacing + "\nMax Number = " + nmax, "Structural Sample", MessageBoxButtons.OK, MessageBoxIcon.Information );

      double angle = VecAngle( wallVec, axis );

      XYZ loc2 = startPt;

      double dx = wallVec.U * spacing;
      double dy = wallVec.V * spacing;

      for( int i = 0; i < nmax; i++ )
      {
        PlaceColumn( rvtApp, rvtDoc, loc2, angle, columnType, baseLevelId, topLevelId );
        loc2 = new XYZ( startPt.X + dx, startPt.Y + dy, startPt.Z );
      }

      PlaceColumn( rvtApp, rvtDoc, endPt, angle, columnType, baseLevelId, topLevelId );
    }
开发者ID:15921050052,项目名称:RevitLookup,代码行数:38,代码来源:StructSample.cs

示例4: IsolateInView

        /// <summary>
        /// Make a single element appear in a particular view
        /// </summary>
        /// <param name="view"></param>
        /// <param name="element"></param>
        protected static void IsolateInView(Autodesk.Revit.DB.View3D view, Autodesk.Revit.DB.Element element)
        {
            var fec = GetVisibleElementFilter();

            view.CropBoxActive = true;
                
            var all = fec.ToElements();
            var toHide =
                fec.ToElements().Where(x => !x.IsHidden(view) && x.CanBeHidden(view) && x.Id != element.Id).Select(x => x.Id).ToList();

            if (toHide.Count > 0)
                view.HideElements(toHide);

            DocumentManager.Regenerate();

            if (view.IsPerspective)
            {
                var farClip = view.get_Parameter("Far Clip Active");
                farClip.Set(0);
            }
            else
            {
                var pts = new List<XYZ>();

                GetPointCloud(element, pts);

                var bounding = view.CropBox;
                var transInverse = bounding.Transform.Inverse;
                var transPts = pts.Select(transInverse.OfPoint);

                //ingore the Z coordindates and find
                //the max X ,Y and Min X, Y in 3d view.
                double dMaxX = 0, dMaxY = 0, dMinX = 0, dMinY = 0;

                bool bFirstPt = true;
                foreach (var pt1 in transPts)
                {
                    if (true == bFirstPt)
                    {
                        dMaxX = pt1.X;
                        dMaxY = pt1.Y;
                        dMinX = pt1.X;
                        dMinY = pt1.Y;
                        bFirstPt = false;
                    }
                    else
                    {
                        if (dMaxX < pt1.X)
                            dMaxX = pt1.X;
                        if (dMaxY < pt1.Y)
                            dMaxY = pt1.Y;
                        if (dMinX > pt1.X)
                            dMinX = pt1.X;
                        if (dMinY > pt1.Y)
                            dMinY = pt1.Y;
                    }
                }

                bounding.Max = new XYZ(dMaxX, dMaxY, bounding.Max.Z);
                bounding.Min = new XYZ(dMinX, dMinY, bounding.Min.Z);
                view.CropBox = bounding;
            }

            view.CropBoxVisible = false;

        }
开发者ID:heegwon,项目名称:Dynamo,代码行数:71,代码来源:View3D.cs

示例5: FrameWall

        /// <summary>
        /// Frame a Wall
        /// </summary>
        /// <param name="rvtApp">Revit application></param>
        /// <param name="wall">Wall as host to place column objects</param>
        /// <param name="spacing">spacing between two columns</param>
        /// <param name="columnType">column type</param>
        private void FrameWall(Autodesk.Revit.ApplicationServices.Application rvtApp, Autodesk.Revit.DB.Wall wall,
            double spacing, Autodesk.Revit.DB.FamilySymbol columnType)
        {
            Autodesk.Revit.DB.Document rvtDoc = wall.Document;

            // get wall location
            Autodesk.Revit.DB.LocationCurve loc = (Autodesk.Revit.DB.LocationCurve)wall.Location;
            Autodesk.Revit.DB.XYZ startPt = loc.Curve.get_EndPoint(0);
            Autodesk.Revit.DB.XYZ endPt = loc.Curve.get_EndPoint(1);

            // get wall's vector
            Autodesk.Revit.DB.UV wallVec = new Autodesk.Revit.DB.UV(
                endPt.X - startPt.X,
                endPt.Y - startPt.Y);

            // get the axis vector
            Autodesk.Revit.DB.UV axis = new Autodesk.Revit.DB.UV(1.0, 0.0);

            Autodesk.Revit.DB.ElementId baseLevelId = wall.get_Parameter(BuiltInParameter.WALL_BASE_CONSTRAINT).AsElementId();
            Autodesk.Revit.DB.ElementId topLevelId = wall.get_Parameter(BuiltInParameter.WALL_HEIGHT_TYPE).AsElementId();

            // get wall length and vector
            double wallLength = wallVec.GetLength();
            wallVec = wallVec.Normalize();

            // get # of column
            int nmax = (int)(wallLength / spacing);

            MessageBox.Show("wallLength = " + wallLength + "\r\nspacing = " + spacing.ToString() + "\r\nnmax = " + nmax.ToString());

            // get angle of wall and axis
            double angle = wallVec.AngleTo(axis);

            // place all column
            Autodesk.Revit.DB.XYZ loc2 = startPt;
            double dx = wallVec.U * spacing;
            double dy = wallVec.V * spacing;
            for (int i = 0; i < nmax; i++)
            {
                PlaceColumn(rvtApp, rvtDoc, loc2, angle, columnType, baseLevelId, topLevelId);

                loc2 = new XYZ(loc2.X + dx,
                    loc2.Y + dy,
                    loc2.Z);
            }

            // place column at end point of wall
            PlaceColumn(rvtApp, rvtDoc, endPt, angle, columnType, baseLevelId, topLevelId);
        }
开发者ID:kdaner,项目名称:04_ProjSpecificPanel_SkyRise-Canopy-Creator,代码行数:56,代码来源:Command.cs


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