zoukankan      html  css  js  c++  java
  • //向块中用程序添加属性

    代码
     //添加属性    //  houlinbo QQ420021327
            private void AddAttJoinWire(Transaction tr, BlockReference refJoinWire, BlockTableRecord  refJoinWireBtr, Point3d newPtWireSLine, int i)
            {
                 Point3d ptWireNo 
    = new Point3d(newPtWireSLine.X + 1, newPtWireSLine.Y + 10);
                
    string wireNo = Convert.ToString(i + 1);
                AttributeDefinition attDefWireNo 
    = new AttributeDefinition(ptWireNo, wireNo, "WIRENO" + wireNo, "芯线序号" + wireNo, db.Textstyle);
                attDefWireNo.Height 
    = 2;
                refJoinWireBtr.AppendEntity(attDefWireNo);
                tr.AddNewlyCreatedDBObject(attDefWireNo, 
    true); //属性定义添加到块的块表记录中,

                AttributeReference attRefWireNo 
    = new AttributeReference();
                attRefWireNo.SetPropertiesFrom(attDefWireNo);
                attRefWireNo.SetAttributeFromBlock(attDefWireNo, refJoinWire.BlockTransform);
                refJoinWire.AttributeCollection.AppendAttribute(attRefWireNo);
                tr.AddNewlyCreatedDBObject(attRefWireNo, 
    true);  //属性引用添加到块的引用中,  如果块表记录中不添加块定义,块引用中将不显示块提示一项
            }
  • 相关阅读:
    每日总结3.8
    Go中定时器实现原理及源码解析
    Go语言实现布谷鸟过滤器
    详解Go语言调度循环源码实现
    Go语言中时间轮的实现
    详解Go语言I/O多路复用netpoller模型
    详解Go中内存分配源码实现
    Go中由WaitGroup引发对内存对齐思考
    【分享】java精品实战教程
    nginx实战教程
  • 原文地址:https://www.cnblogs.com/houlinbo/p/1625013.html
Copyright © 2011-2022 走看看