zoukankan      html  css  js  c++  java
  • 移除实体应用程序名(xdata)

    代码
            /// <summary>
            
    /// 移除实体应用程序名(xdata) houlinbo QQ420021327
             /// </summary>
            
    /// <param name="Objid"></param>
            
    /// <param name="sAppName"></param>
            public void RemoveAppName(Database db, ObjectId objId, string sAppName)
            {
                
    using (Transaction tr = db.TransactionManager.StartTransaction())
                {
                    DBObject obj 
    = tr.GetObject(objId, OpenMode.ForWrite);
                    ResultBuffer rb 
    = obj.XData;
                    
    if (rb != null)
                    {
                        TypedValue[] values 
    = rb.AsArray();
                        
    for (int i = 0; i < values.Length; i++)
                        {
                            
    if (values[i].TypeCode ==
                                (
    int)DxfCode.ExtendedDataRegAppName && values[i].Value.ToString() ==
                                sAppName)
                            {
                                
    //移除之
                                TypedValue[] values_New =new TypedValue((int)DxfCode.ExtendedDataRegAppName, values[i].Value.ToString()) };
                                ResultBuffer rb_New 
    = new ResultBuffer(values_New);
                                obj.UpgradeOpen();
                                obj.XData 
    = rb_New;
                                obj.DowngradeOpen();
                            }
                        }
                    }
                    tr.Commit();
                }
            }
  • 相关阅读:
    parent.relativePath' points at wrong local POM
    'cmd' 不是内部或外部命令,也不是可运行的程序 或批处理文件.
    解析xml文件的几种技术与Dom4j与sax之间的对比
    html/js/css资源
    HTML编码规范
    CSS编码规范
    PCB标识说明
    sama5d3 环境检测 gpio--yk测试
    sama5d3 环境检测 gpio--yx测试
    ad7888 linux driver
  • 原文地址:https://www.cnblogs.com/houlinbo/p/1878618.html
Copyright © 2011-2022 走看看