• 创建新的线样式


            /// <summary>
            /// 创建新的线样式
            /// </summary>
            /// <param name="newColor"></param>
            /// <param name="weight"></param>
            /// <param name="linePatternId"></param>
            /// <returns></returns>
            private Category CreateNewLineType()
            {
                //获得设置里面的线
                Category lineCategory = doc.Settings.Categories.get_Item(BuiltInCategory.OST_Lines);
                //得到这个线下面所有的线样式
                var subcats = lineCategory.SubCategories;
                foreach (Category item in subcats)
                {
                    if (item.Name == "标记线")
                    {
                        //通过样式名称,查找我们自己设定的样式
                        _lineStyle = item;
                    }
                }
                if (_lineStyle == null)
                {
                    //所有的线型图案,即实线、中心线、点划线等
                    //List<LinePatternElement> linePatternElements = new FilteredElementCollector(doc).OfClass(typeof(LinePatternElement)).Select(s => s as LinePatternElement).ToList();
                    //LinePatternElement linePattern = linePatternElements.FirstOrDefault(x => x.Name == "划线");
    
                    Category newCategory = null;
                    newCategory = doc.Settings.Categories.NewSubcategory(lineCategory, "标记线");
                    //设置线的颜色
                    newCategory.LineColor = new Color(0,166,0);
                    //设置线的线型
                    //newCategory.SetLinePatternId(linePattern.Id, GraphicsStyleType.Projection);
                    //设置线宽
                    //newCategory.SetLineWeight(weight, GraphicsStyleType.Projection);
                    return newCategory;
                }
                return _lineStyle;
            }
            /// <summary>
            /// 线样式
            /// </summary>
            private Category _lineStyle { get; set; }
    
    //详情线设置线样式
    DetailCurve.LineStyle = _lineStyle.GetGraphicsStyle(GraphicsStyleType.Projection)
  • 相关阅读:
    ceph 手工部署
    zstack 搭建部署
    ceph crush
    mini2440动态加载hello.ko模块
    j-flash配置用于烧录mini 2440 nor flash
    (转载)PPP协议规范
    at91sam9263: 定时器
    cyg_io_read返回值是0,因为读到的字节长度在参数中
    read函数
    Linux编译错误:‘cout’在此作用域中尚未声明
  • 原文地址:https://www.cnblogs.com/jayrocking/p/15347262.html
Copyright © 2020-2023  润新知