zoukankan      html  css  js  c++  java
  • 转帖:获取样式名称

    原贴链接

    1 条消息(共 2 条)
    24 次查看, 1 条回复
     
     
    Profile Style Collection C#

    Is there any way to get profile styles in the current dwg.

    I want to list the styles.

    ObjectId styleId = doc.Styles.ProfileStyles[0];
    ObjectId labelSetId = doc.Styles.LabelSetStyles.ProfileLabelSetStyles[0];

    Above code only gets 1st style.

    Is there any way same like this below?

    oAlignments = doc.GetAlignmentIds();





    2 条消息(共 2 条)
     
     
     

    This is an extension method to get the names of any StyleCollection:

            public static List<string> StyleCollectionNames(this StyleCollectionBase scb)
            {
                var list = new List<string>();
                foreach(ObjectId id in scb)
                {
                    var style = (StyleBase)id.Open(OpenMode.ForRead);
                    list.Add(style.Name);
                    style.Close();
                }
                return list;
            }
    

    and sample usage:

            var stylelist = CivilApplication.ActiveDocument.Styles.ProfileStyles.StyleCollectionNames();
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("
    The first name in the list is {0}", stylelist[0]);
            var setslist = CivilApplication.ActiveDocument.Styles.LabelSetStyles.ProfileLabelSetStyles.StyleCollectionNames();
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("
    The first name in the list is {0}", setslist[0]);
    
    
  • 相关阅读:
    $().each和$("input[name='XXX']")
    常规JS操作
    日期大小比较JS方法
    集合迭代
    技术点1
    GItHub pages 的使用方法
    node.js是做什么的?
    jQuery基础:下(事件及动画效果)
    jQuery基础:上(样式及DOM操作)
    页码demo制作
  • 原文地址:https://www.cnblogs.com/myzw/p/13587751.html
Copyright © 2011-2022 走看看