04 2014 档案
摘要://a button click call back event... private void getEntity_Click(object sender, EventArgs e) { Document doc = Autodes...
阅读全文
摘要:[0-9]+ 表示一个或多个【数字】\.+ 表示数字后紧接一个【.】,由于【.】是正则中的关键字,所以需要转义一下+表示后面紧跟一个或多个【空格】\n 表示替换成换行符
阅读全文
摘要:将这一句中加入openerased的选项,这样对于已经删除的块就不会去遍历了。AttributeReference attRef = (AttributeReference)trans.GetObject(attId, OpenMode.ForRead,true); /// ...
阅读全文
摘要:1.正则表达式基本语法两个特殊的符号'^'和'$'。他们的作用是分别指出一个字符串的开始和结束。例子如下:"^The":表示所有以"The"开始的字符串("There","The cat"等);"of despair$":表示所以以"of despair"结尾的字符串;"^abc$":表示开始和结尾...
阅读全文
摘要:"^\d+$" //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$" //正整数 "^((-\d+)|(0+))$" //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$" //负整数 "^-?\d+$" //整数 "^\d+(\.\d+)?$" //非负...
阅读全文
摘要:一、CACHEMAXFILES (系统变量)设置为产品保存的图形缓存文件的最大数量。 类型: 整数 保存位置: 注册表 初始值: 256 有效范围为从 0 到 65535 个文件。 当图形缓存文件的数量达到最大时,将自动删除缓存中最早的文件。将此变量设定为 0(零)可完全禁用缓存,并删除任何不在打开...
阅读全文
摘要:http://jingyan.baidu.com/article/ce436649f812593773afd3df.html
阅读全文
摘要:using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.GraphicsInterface; using Autodesk.AutoCAD.Colors; //__________________...
阅读全文
摘要:ImageList ImgList = new ImageList(); //高度设置 ImgList.ImageSize = new Size(1, lv_1.Font.Height + 2); //在Details显示模式下,小图标才会起作用 lv_1.SmallImageList = ImgList;
阅读全文
摘要:#region Contains重载函数 /// /// 判断块说明中是否包含指定词组 /// /// 父字符串 /// 指定关键词的集合 /// 是否包含全部才返回true /// 返回bool类型 public static bool Contains(this string str, List strs,bool containAll) { if (!containAll) foreach (...
阅读全文
摘要:#region 将handle转换为objectid /// /// 将handle转换为objectid /// /// database /// handle字符串 /// ObjectId public static ObjectId GetObjectId(this Database db, string handle) { Handle h = new Handle(Int64.Parse(handle, NumberStyles....
阅读全文
摘要:#region 属性自动缩进 /// /// 属性比例因子设置 /// /// 属性块参照 /// 属性宽度集合 /// 标准比例因子 public static void setAttributeReferenceWidth(this BlockReference br, List lstWidth,double Factor) { //定义事务对象 var trans = br.Id.Database.Transac...
阅读全文
摘要:int i=10;方法1:Console.WriteLine(i.ToString("D5"));方法2:Console.WriteLine(i.ToString().PadLeft(5,'0'));//推荐方法3:Console.WriteLine(i.ToString("00000"));在 C# 中可以对字符串使用 PadLeft 和 PadRight 进行轻松地补位。PadLeft(int totalWidth, char paddingChar) //在字符串左边用 paddingChar 补足 totalWidth 长度Pad
阅读全文
摘要:1,从System.String[]转到ListSystem.String[] str={"str","string","abc"};List listS=new List(str);2, 从List转到System.String[]List listS=new List();listS.Add("str");listS.Add("hello");System.String[] str=listS.ToArray();测试如下:using System;using System.Collecti
阅读全文
摘要:要点:泛型类型转换(T)后面只接受object类型;(T)后面接的object如果本身是string,则只能转换成string,否则应先进行类型转换。如:T为double,则应先将string转换为double,再将double转换为object后才可以返回值;判断T类型只能通过两边都typeOf的格式,如:typeof(T) == typeof(int); #region 字符串转集合 /// /// 字符串转集合 /// 目前仅支持string和int类型 /// /// 数据类型 ///...
阅读全文