用.Net开发Cad

Cad二次开发

 

2014年10月14日

代码创建多重引线样式和绘制多重引线

摘要: using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.Colors;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.Geometry;using... 阅读全文

posted @ 2014-10-14 09:41 xuguangren 阅读(1255) 评论(0) 推荐(0) 编辑

2011年10月19日

使用替换功能删除多余空行

摘要: 用VSS迁入迁出过的代码,常常莫名奇妙的随机添加了一行空行。而VS2010中的Ctrl+K,Ctrl+D快捷键并不会自动去除多余空行。不要紧,只需在【替换】中选择【使用正则表达式】,查找内容为 \n[\n]# 替换为\n ,再全部替换几次(这样段落间的空行不会被删除),这样格式就清楚了。【修改前空格乱七八糟的代码】view sourceprint?1public class A 23{ 4private int field; // 56private int adsfdsf; // 78private int sssss; // 9private string a = "adsfad 阅读全文

posted @ 2011-10-19 16:00 xuguangren 阅读(438) 评论(0) 推荐(0) 编辑

2011年10月9日

CAD病毒

摘要: 病毒症状 在8:00--18:00的时间段内,打开CAD软件时出现一个界面框:现在时间是X点XX分了的哦!好好干哦!党是不会亏待你的!老板的眼睛是雪亮的啦! 在其它时间段内会显示:现在时间是:XX点XX分了的哦!快点休息了啦!要不做CAD的饭碗都让你一个人抢了哦!感染与传播 该病毒利用CAD的读取机制,在第一次打开带有病毒的图纸后,该病毒即悄悄运行,并感染每一张新打开的图纸,将病毒文件到处复制,并生成很多名为acad.lsp的程序。即便是重装CAD甚至重装系统都不能解决问题。病毒感染计算机系统后,会在搜索AutoCAD软件数据库路径下的自动运行文件(acad.lsp)后,生成一个备份文件... 阅读全文

posted @ 2011-10-09 07:51 xuguangren 阅读(398) 评论(0) 推荐(0) 编辑

2011年9月29日

comboBox.SelectedItem与SelectedText区别

摘要: ->SelectedItem是指当前选定项的对象,而不是文本SelectedItem 属性设置为一个对象时,ComboBox 尝试使该对象成为列表中当前选定的对象。如果在列表中找到了该对象,则将它显示在 ComboBox 的编辑部分,并且将 SelectedIndex 属性设置为相应的索引。如果列表中不存在该对象,则 SelectedIndex 属性保留其当前值。comboBox.SelectedText:表示组合框中当前选定文本的字符串,如果 DropDownStyle 设置为 comboBoxStyle.DropDownList,则返回值为空字符串 ("")。co 阅读全文

posted @ 2011-09-29 19:38 xuguangren 阅读(1901) 评论(0) 推荐(0) 编辑

2011年9月19日

如何将新增加的textstyletablerecord设为当前

摘要: Database.Textstyle = Tools.AddTextStyle("断面"); //设置当前文字样式public static ObjectId AddTextStyle(string StyleName) { ObjectId id; Database db = Tools.Database; DBTransMan tm = Tools.TransactionManager; Transaction ta = tm.StartTransaction(); TextStyleTable textStyleTable = (TextStyleTable)tm.G 阅读全文

posted @ 2011-09-19 20:00 xuguangren 阅读(697) 评论(0) 推荐(0) 编辑

删除扩展数

摘要: 文章地址:http://bbs.mjtd.com/forum-33-1.html public static void RemoveXData(Entity EntObject, string XDataName) { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; Database db = HostApplicationServices.WorkingDatabase; using (DocumentLock... 阅读全文

posted @ 2011-09-19 19:19 xuguangren 阅读(236) 评论(0) 推荐(0) 编辑

2011年9月16日

在命名对象词典中添加数据获取数据

摘要: 文章地址:http://blog.csdn.net/yuandingmao/article/details/5563461/*********************************************************************** * FileName: DBDictionaryClass .CS * File Created: 2010-4-9 15:26 * Description: 数据字典,数据字典引用 * Purpose : * History: * Creator : ******************... 阅读全文

posted @ 2011-09-16 13:09 xuguangren 阅读(539) 评论(0) 推荐(0) 编辑

添加扩展数据XDATA

摘要: 文章地址:http://blog.csdn.net/yuandingmao/article/details/5563452使用ResultBuffer类 在ObjectARX中,resbuf结构给AutoCAD专门数据提供了一个灵活的存储器。在托管API中,这个结构被映射在Autodesk.AutoCAD.DatabaseServices.ResultBuffer类中。 一个ResultBuffer类对象使用的方法与resbuf数据链相同。你要定义一个ResultBuffer并使它产生一系列的数据对。每一对数据由一个数据类型描述和一个值组成。在托管API中, 这些数据对是Autodesk... 阅读全文

posted @ 2011-09-16 13:04 xuguangren 阅读(1014) 评论(0) 推荐(0) 编辑

2011年9月14日

用acdbGetAdsName获得图元名,用acedSSAdd加入到选择集,用acedSSSetFirst亮显并选择

摘要: static void mydraw_ddd(void){ // Add your code for command mydraw._ddd here ads_point pt1,pt2; if( acedGetPoint(NULL,_T("\nPlease Enter start point: "),pt1) != RTNORM || acedGetPoint(pt1,_T("\nPlease Enter end point: "),pt2)!= RTNORM) return; ... 阅读全文

posted @ 2011-09-14 09:30 xuguangren 阅读(768) 评论(0) 推荐(0) 编辑

导航