基于SCR脚本文件的Matlab/AutoCAD结合使用
郭彩立
(重庆市勘测院,重庆 400020)
摘要本文首先结合在AutoCAD中创建图层和添加文字样式的脚本文件,分别介绍了AutoCAD中SCR脚本文件编写、执行方法及注意事项;然后在Matlab中编写程序实现从Excel文件中读取所需数据,并生成SCR脚本文件,并在AutoCAD中执行生成的脚本文件;最后,将上述方法应用于重庆市现代测绘基准体系建设过程中不同数据处理方案所得结果的较差统计分析,并实现对不同数据处理结果之间较差的地理空间分布情况的显示,为选择最优方案提供了直观的依据。同时验证了方法的可行性,也为这些常用软件的结合使用提供了一种新方法。
关键词工程测量技术;Matlab;AutoCAD;SCR脚本文件
Combination of Matlab and AutoCAD Based on SCR Script
File
Guo Caili
(Chongqing Survey Institute, Chongqing 400020, China)
Abstract: Firstly, combine with the establishment of script files to create a new layer and text style in AutoCAD, this paper discussed the edit, execute method and matters need attention of the script file. And then this paper writes the program using Matlab, which reads data from Excel, creates AutoCAD SCR script file, and then the above SCR file is executed in the AutoCAD to realize the graph display. At last, this paper applied the above method to analysis the range of different surveying results during the Chongqing modern surveying datum establishment and display the spatial placement, which puts forward the intuitionistic basis to select the appropriate method. At the same time, the feasibility of the method is verified and a new approach to use above commonly-used software is putted forward.
Keywords: Engineering Surveying Technology; Matlab; AutoCAD; SCR Script File
1 引言
文献[1]提出借助Excel软件编写AutoCAD脚本SCR文件的方法实现在CAD中批量展点的功能[1]。该方法完全是手动操作完成,过程繁琐且容易出错;文献[2]中在Excel软件中通过VBA编程实现了自动将测量坐标数据绘制在AutoCAD图形中[2],但是这种方法需要使用人员具有一定的VBA编程经验,在使用的推广上有一定的局限性。
本文利用Matlab语言读取EXCEL中数据,编写生成SCR脚本文件,实现统计结果的