shilvyan  

2013年5月10日

摘要: View Code 1 /// <summary> 2 /// 保存文档 3 /// </summary> 4 /// <param name="txt"></param> 5 /// <param name="filename"></param> 6 public void Save(string txt, string filename) 7 { 8 if (txt != string.Empty) 9 {10 S... 阅读全文
posted @ 2013-05-10 10:21 shilvyan 阅读(245) 评论(0) 推荐(0) 编辑
 
摘要: /// /****点到直线的距离*** /* 过点(x1,y1)和点(x2,y2)的直线方程为:KX -Y + (x2y1 - x1y2)/(x2-x1) = 0 * 设直线斜率为K = (y2-y1)/(x2-x1),C=(x2y1 - x1y2)/(x2-x1) * 点P(x0,y0)到直线AX + BY +C =0DE 距离为:d=|Ax0 + By0 + C|/sqrt(A*A + B*B) * 点(x3,y3)到经过点(x1,y1)和点(x2,y2)的直线的最短距离为: * distance = |K*x3 - y3 + C|/sqrt(K*K + 1) */View Code .. 阅读全文
posted @ 2013-05-10 10:18 shilvyan 阅读(566) 评论(0) 推荐(0) 编辑
 
摘要: 1- 类GCD public class GCD:IComparable { //高程点X坐标 private double gcdX; public double GcdX { get { return gcdX; } set { gcdX = value; } } //高程点Y坐标 private double gcdY; public double GcdY { get { return gc... 阅读全文
posted @ 2013-05-10 10:08 shilvyan 阅读(505) 评论(0) 推荐(0) 编辑

2013年5月9日

摘要: 1 /// <summary> 2 /// 计算方位角,从某点的指北方向线起,依顺时针方向到目标方向线之间的水平夹角。 3 /// </summary> 4 /// <param name="gcdStart"></param> 5 /// <param name="gcdEnd"></param> 6 /// <returns></returns> 7 public const double PI = 3.1415926;//定义常量PI 8 public 阅读全文
posted @ 2013-05-09 14:44 shilvyan 阅读(760) 评论(1) 推荐(0) 编辑
 
摘要: 1 /// <summary> 2 /// 加载CAD自定义线型 3 /// </summary> 4 /// <param name="strLinetype"></param> 5 /// <param name="strFileName"></param> 6 /// <param name="Success"></param> 7 /// <returns></returns> 8 /// LoadLinet 阅读全文
posted @ 2013-05-09 14:42 shilvyan 阅读(885) 评论(0) 推荐(0) 编辑
 
摘要: 1 /// <summary> 2 /// 绘制断面方向 多段线 3 /// </summary> 4 /// <param name="polylineStartPoint"></param> 5 /// <param name="polylineEndPoint"></param> 6 /// <param name="lintypeId"></param> 7 public Line DrawDMFX(Point3d polyline 阅读全文
posted @ 2013-05-09 14:34 shilvyan 阅读(5139) 评论(2) 推荐(0) 编辑
 
摘要: 1--实体的选择集 1 PromptEntityOptions entPline = new PromptEntityOptions("选择一条断面线:"); 2 PromptEntityResult entPlineRes = ed.GetEntity(entPline); 3 4 if (entPlineRes.Status == PromptStatus.OK) 5 { 6 Polyline entpolyline = ... 阅读全文
posted @ 2013-05-09 14:29 shilvyan 阅读(13032) 评论(1) 推荐(1) 编辑

2013年4月17日

摘要: 获取当前活动的AutoCAD对象 ,下面语句只适合AutoCAD打开的情况,否则会发生错误,对于AutoCAD没有打开的情况后续会阐述。View Code namespace AcadExample{ public class AutoCADConnector : IDisposable { private AcadApplication _application; private bool _initialized; private bool _dispoased; public AutoCADConnector() ... 阅读全文
posted @ 2013-04-17 09:57 shilvyan 阅读(1553) 评论(0) 推荐(0) 编辑