基于Visual C#语言及ActiveX Automation技术,研究AutoCAD中首尾相连线段转换为多段线的方法.首先读取首尾相连线段集的端点.然后将读取到的端点即多段线的节点存入数组中,最后调用ActiveXAutomation中现有的函数生成多段线.实验证明该方法能够成功地将多组首尾相连线段转换成一条或几条多段线.比Auto—CAD中PE命令简单方便.且具有更好的执行效率.
The method of transforming end-to-end lines into poly-lines is briefly illustrated. With this method, Visual C# language and ActiveX Automation technology are adopted to read the ends of the end-to-end lines, record the ends, i.e. the nodes into the array, and call the existing functions in ActiveX Automation to produce the poly-lines. The experiment confirms that this method can successfully transform multi-groups of end-to-end lines into one or more poly-lines, which is more convenient than the command of PE in AutoCAD and has better execution efficiency.