欢迎加我的QQ群:193522571,一起来讨论、交流!
摘要: 在C#中如下代码 var cbo = new ComboBox();cbo.DropDownStyle = ComboBoxStyle.DropDownList;var cbo.DataSource = new int[]{1, 2, 3};cbo.SelectedIndex = 0;cbo.Sel 阅读全文
posted @ 2023-08-12 20:44 swtool 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 这个是由于你的程序在运行过程中开启了新线程,而在结束时没有把线程退出 private void BtnUpdate_Click(object sender, EventArgs e) { int iX = this.Left; int iY = this.Top; Thread thr = "更新" 阅读全文
posted @ 2023-08-12 14:23 swtool 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 发现把最小距离输入一个特别小的值后,此问题可以解决,虽然有点蹊跷,但能解决问题。 阅读全文
posted @ 2023-06-29 09:04 swtool 阅读(8) 评论(0) 推荐(0) 编辑
摘要: dbtext取得其GeometricExtents时,发现ext特别大,暂时不知道什么原因,所以在程序中把文字去掉了。 这一个东西测试了很长时间。 public static void ZoomObjects(this Editor ed, ObjectIdCollection idCol) { D 阅读全文
posted @ 2023-05-28 09:57 swtool 阅读(29) 评论(0) 推荐(0) 编辑
摘要: public static void AddAttsToBlock(this ObjectId blockId, List<AttributeDefinition> atts, bool copyEntity = false) { Entity attNew; Database db = block 阅读全文
posted @ 2023-04-24 16:02 swtool 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 这个玩意绝对是个坑,CAD对Getselection的支持并不充分,需要通过keywordinput事件来弄,比较麻烦,而且很容易出问题。 所以我的做法是,不使用,哈哈! 下面这个是kean的代码: [CommandMethod("SELKW")] public void GetSelectionW 阅读全文
posted @ 2023-04-24 08:18 swtool 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 出现此错误原因是低版本无法打开高版本的DWG 阅读全文
posted @ 2023-04-18 10:25 swtool 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 在块编辑界面,点击工具栏里-【管理】栏上面的【构造几何图形工具】(或者直接输入命令:bconstruction), 然后选择一条线段,输入【c】,就可以把这条线段变成灰显的虚线,也就是从常规几何图形转换成了构造几何图形。 块参照中不显示构造几何图形;它在块编辑器中以灰色虚线线型显示。无法修改构造几何 阅读全文
posted @ 2023-02-27 09:18 swtool 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 相乘不能调整位置,A*B表示把A应用到B,这个一定要注意。 阅读全文
posted @ 2023-02-14 15:26 swtool 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1.WCS —— 世界坐标系即参照坐标系。其它所有的坐标系都是相对WCS定义的,WCS是永远不改变的。相对于WCS测量的值可以忽略其它坐标系统的变化。 2.UCS —— 用户坐标系统即工作中的坐标系。用户指定一个UCS以便绘图更容易。所有传到AutoCAD命令的点,包括那些从ObjectArx程序和 阅读全文
posted @ 2023-01-25 18:13 swtool 阅读(1121) 评论(0) 推荐(0) 编辑
摘要: 布局自己本身就是一个视口。 Use Database.GetViewports(true) 依次返回的是,模型空间中的视口、布局一本身、布局一中的视口、布局二本身、布局二中的视口。 Use Database.GetViewports(false) 返回的是布局中的视口。排除了模型空间中的视口和布局本 阅读全文
posted @ 2023-01-19 13:36 swtool 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 优先级排序为:算术运算符 > 关系运算符 > 赋值运算。 算术运算符中,- 负数(如 –1)、% 百分比、^ 乘方、* 和 / (乘和除)、+ 和 –(加和减 )属于优先级第三级,加法运算符【+】、减法运算符【-】属于第四级。 关系运算符有6种关系,分别为小于、小于等于、大于、等于、大于等于、不等于 阅读全文
posted @ 2022-10-10 14:10 swtool 阅读(411) 评论(0) 推荐(0) 编辑
摘要: 取得块参照中一条线的开始点 Point3d ptA = ln.StartPoint.TransformBy(br.BlockTransform); 阅读全文
posted @ 2022-10-05 08:11 swtool 阅读(39) 评论(0) 推荐(0) 编辑
摘要: private void btnSave_Click(object sender, EventArgs e) { //定义数据库 Database db = HostApplicationServices.WorkingDatabase; if (dicIds.Count < 11) return; 阅读全文
posted @ 2022-10-04 17:20 swtool 阅读(68) 评论(0) 推荐(0) 编辑
摘要: “此图形中的一个或多个对象无法保存为指定格式。操作未完成 ,因此未创建任何文件。” 这个有可能是你在用程序绘图时,画了0长度的线,或者0直径的圆等类似的情况。 所以在函数中要判断下参数的有效性。 阅读全文
posted @ 2022-10-01 14:49 swtool 阅读(3443) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/hdwang/p/3922987.html 搜索 复制 阅读全文
posted @ 2022-06-27 13:28 swtool 阅读(253) 评论(0) 推荐(0) 编辑
摘要: //直接复制此代码到FORM代码下面即可 protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) //激活回车键 { int WM_K 阅读全文
posted @ 2022-06-26 09:45 swtool 阅读(505) 评论(2) 推荐(0) 编辑
摘要: 点击上面的设置按钮后会比较慢,请耐心等待。 提交后,MSSQL上就导入成功了,然后使用UpdateSql2Sqlite工具从MSSQL复制到本地Sqlite库中。 阅读全文
posted @ 2022-03-25 11:31 swtool 阅读(50) 评论(0) 推荐(0) 编辑
摘要: If vertical mode is AcDb::kTextBase and horizontal mode is either AcDb::kTextLeft, AcDb::kTextAlign, or AcDb::kTextFit, then the position point (DXF g 阅读全文
posted @ 2021-12-12 20:25 swtool 阅读(80) 评论(0) 推荐(0) 编辑
摘要: ''是加在字符串上的 sqlStr = string.Format("select * from NameReplace where FK_JobNoId = {0} and FileName = '{1}'", sListID, sOld); 阅读全文
posted @ 2021-12-07 15:33 swtool 阅读(169) 评论(0) 推荐(0) 编辑
摘要: using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.GraphicsInterface; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Applicat 阅读全文
posted @ 2021-11-30 18:41 swtool 阅读(62) 评论(0) 推荐(0) 编辑
摘要: The allowed values for version are: DwgVersion.AC1014 // R14 DwgVersion.AC1015 // 2000 DwgVersion.AC1800 // 2004 DwgVersion.AC1021 // 2007 DwgVersion. 阅读全文
posted @ 2021-11-24 10:58 swtool 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Type BstrType = typeof(CadBaseSet); DataTable dt = (DataTable)BstrType.GetField(sTableOrFolderName).GetValue(BstrType); 阅读全文
posted @ 2021-11-19 15:11 swtool 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 3D View 转 2D //3D View 转 2D dbInsert.TileMode = true; var vStyles = (DBDictionary)sideTr.GetObject(db.VisualStyleDictionaryId, OpenMode.ForRead); var 阅读全文
posted @ 2021-11-15 10:50 swtool 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 以前是这样的: cbSerial1.DataSource = null; 当cbSerial1控件重新绑定后会出现下拉后显示值不变的问题。 后面修改成这样: cbSerial1.DataSource = new List<string>(); cbSerial1.DataSource = dtDat 阅读全文
posted @ 2021-10-16 14:32 swtool 阅读(203) 评论(0) 推荐(0) 编辑
摘要: List<XY> lstTemp = new List<XY>(); lstTemp = lstInner; lstTemp.AddRange(lstPt); 结果lstInner因为lstTemp变化而变化了,呵呵 阅读全文
posted @ 2021-10-15 15:08 swtool 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 尝试了n多种方法,都没有结果,最后用的这个最为朴实的tooltips ttp.IsBalloon = true; ttp.Show(string.Format("文件{0}保存成功!", xmlName), btnSave, 20,-50,2000); 尝试的方法有:notifyicon,statu 阅读全文
posted @ 2021-10-07 10:42 swtool 阅读(33) 评论(0) 推荐(0) 编辑
摘要: indexof忽略大小写,否则基函数出错,取得的位置是-1 str=螺柱 [Th]XBoltLen([Tg]-6+[Tc]+[L]*1.5-2)L khLeft=boltlen( int a = str.IndexOf(khLeft, StringComparison.CurrentCultureI 阅读全文
posted @ 2021-09-22 11:07 swtool 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 此图形中的一个或多个对象无法保存为指定格式。操作未完成,因此未创建任何文件。 "One or more objects in this drawing cannot be saved to the specified format. The operation was not completed a 阅读全文
posted @ 2021-09-08 10:37 swtool 阅读(3203) 评论(0) 推荐(0) 编辑
摘要: public class Resources public static global::System.Resources.ResourceManager ResourceManager public static global::System.Globalization.CultureInfo C 阅读全文
posted @ 2021-09-05 15:42 swtool 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 图层表搞成静态类后就出现了各种问题 public static LayerTable zlt; 这个玩意不能用静态类来保存, 因为相同的层名在不同的图形中其id是不一样的。 然后执行下面代码时 db.Clayer = zlt[sLayer; 导致db.Clayer赋值了一个莫名其妙的id 就出错了! 阅读全文
posted @ 2021-08-31 15:57 swtool 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 窗体强制居中于CAD中心 var result = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(doc.Window.Handle, frm, false); if (result == DialogResult. 阅读全文
posted @ 2021-08-29 18:48 swtool 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1.在Windows系统下,使用鼠标拖动软件窗口; 2.不小心鼠标甩了一下,或着急情况下,突然的鼠标拖动,软件窗口不见了,这时不要慌张; 3.选择软件窗口以后,直接按快捷键【alt】+【space】,以激活软件窗口的控制菜单; 5.接着,移动鼠标,窗体就随着你的鼠标移动了; 阅读全文
posted @ 2021-08-26 15:31 swtool 阅读(1423) 评论(0) 推荐(0) 编辑
摘要: [CommandMethod("DFL", CommandFlags.Session)] 加了CommandFlags.Session后就会出现 eLockviolation的错误。 ************** 异常文本 **************Autodesk.AutoCAD.Runtime 阅读全文
posted @ 2021-08-23 16:29 swtool 阅读(238) 评论(0) 推荐(0) 编辑
摘要: ObjectId idHR = db.CreateWipeOut(mAa, mCa, mDa, mEa, mFa, m7a, m7b, mFb, mEb, mDb, mCb, mAb); idHR.MoveBotTo(zMainEntIdsRight); idHR.Move(ptCenter, 0, 阅读全文
posted @ 2021-07-06 10:57 swtool 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 这个椭圆好坑。 /// <summary> /// 绘制椭圆及椭圆弧,注意当dX>dY时以X轴正方向为起始角,当dX<dY时以Y轴正方向为起始角 /// </summary> /// <param name="db"></param> /// <param name="pt">椭圆中心点</para 阅读全文
posted @ 2021-07-06 09:19 swtool 阅读(160) 评论(0) 推荐(0) 编辑
摘要: ObjectId[] ResultNestedContainer = ResultNested.GetContainers(); 0:Dimension 1:BlockReferense 阅读全文
posted @ 2021-07-04 14:18 swtool 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 当标注文字被修改过时, 我们应该读取DimensionText属性, 如果没有被修改过则应读取Measurement。 没有被修改的标注其DimensionText为空。 if (ObjectId.ObjectClass.IsDerivedFrom(RXObject.GetClass(typeof( 阅读全文
posted @ 2021-07-04 11:57 swtool 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1.在Test文件夹中增加新的Winform项目P1,并且进行前期的窗体调试; 注意需要把tlpMain设置为public: public System.Windows.Forms.TableLayoutPanel tlpMain; 2.在PressureVessel项目中链接P1; 修改P1项目代 阅读全文
posted @ 2021-06-29 15:27 swtool 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Point3d pt1 = Autodesk.AutoCAD.Internal.Utils.UcsToDisplay(item.MinPoint, false); Point3d pt2 = Autodesk.AutoCAD.Internal.Utils.UcsToDisplay(item.MaxP 阅读全文
posted @ 2021-06-18 16:27 swtool 阅读(144) 评论(0) 推荐(0) 编辑
欢迎加我的QQ群:193522571,一起来讨论、交流!