应用Excel编制AutoCAD脚本文件实现批量展点绘图_第1页
应用Excel编制AutoCAD脚本文件实现批量展点绘图_第2页
应用Excel编制AutoCAD脚本文件实现批量展点绘图_第3页
应用Excel编制AutoCAD脚本文件实现批量展点绘图_第4页
应用Excel编制AutoCAD脚本文件实现批量展点绘图_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 计算机应用应用Excel 编制Aut oC AD 脚本文件实现批量展点绘图邱章云(葛洲坝股份公司测绘总队, 湖北宜昌443002摘要:文中介绍了以Excel 作为数据处理工具, 应用Aut oC AD 中脚本文件(3. scr 作为批处理程序实现自动批量展点、标注高程、绘制断面图等功能。以此代替原始的手工绘图, 关键词:Aut oCAD; Excel; 数字化成图; 脚本文件; 中图分类号:T B23文献标识码:B :-( -03、和Excel 基础, 即可以实现“批量展点绘图及电子表格自动计量, 从而摆脱传统手工绘图和手工量算面积计量带来的诸多不便。Aut oCAD 和Excel 是目前国

2、内外使用非常广泛应A 、B 、C 、D 、E 各列, 只采用Y 坐标(C , X 坐标(D 两列, 在任意空白列相对应的单元格如G1中输入文本合并公式:=" point " &C1&", " &D1, 内为公式表达式, 用鼠标拖动填充柄经过待填充区域, 既得到脚本文件所需文本, 见图1:(为保留小数点后两位, 采用了“LEFT ”函数。 的CAD 绘图和office 办公软件。当前最流行的版本是Aut oCAD 2000和Excel 2000中文版。可以把一系列需要重复使用的Aut oCAD 绘图命令和参数编写成脚本文件。脚本文件

3、是ASC II 码文本文件, 类型为3. scr, 可在任意文本编辑器中编写构成一命令序列, 相当于一个程序。在Aut oCAD 中用" scri p t" 命令测试和运行此文件, 即可按指定顺序执行这些命令(类似于DOS 系统中的批处理功能 。编写脚本文件的格式规则主要为:空格即代表回车, 不得随意增减空格, 须清楚所用Aut oCAD 绘图命令及参数的使用情况, 本文示例中均以“”表示空格; 字母大小写不限, 但空格或双引号等符号须在英文标点状态下输入。所介绍的批量展点绘图主要以脚本文件(3. scr 为主来实现。1Aut oCAD 批量展点绘图图1脚本文件所需文本将该

4、列文本内容剪贴到word 或者记事本中, 另存为纯文本文件, 扩展名为scr, 文件内容示例如下:point 49850184, 19299147point 49855191, 19277128point 49839163, 19298186point 49839166, 19270142此外, 还可以采用Aut oL I SP 语言的表达形式, 其标准格式为:(command" point" " Y, X" 。用Excel 处理:插入两列如L 、M 列, 内容为(co mmand" point" " 和" , 内

5、为单元格填充内容, 在另空白列N 相应单元格中输入文本合并公式:=L1&C1&", "D1&M1, 用鼠标拖动填充柄经过待填充区域, 后得到如下文本:(command" point" " 49850184, 19299147" (command" point" " 49855191, 19277128" (command" point" " 49839163, 19298186" 需掌握三个Aut oCAD 命令:展点"

6、point" ; 写文字" text" ; 画直线段" line" 。111展点其脚本文件格式为:point Y, X 。如测了一段公路的带状地形, 将野外采集的原始数据按Aut o 2CAD 默认的绘图设置(数学坐标系 编辑成三维坐标数据格式(点号, 编码, Y, X, H , 存为文本文件。在Excel 中打开该文件, 点号、编码、Y 、X 、H 分别对52 (command" point" " 49839166, 19270142" 同理存为扩展名为scr 的纯文本脚本文件。以上脚本文件(31scr

7、 生成后, 在Aut oCAD 菜单" t ools" 中调用" Run scri p t 111" 命令, 或直接在命令行中输入" scri p t" , 弹出打开文件对话框, 选定刚生成的31scr 文件, 即可完成绘图, 以下类同。112标注高程如需要展测点高程, 则用Excel 打开上述三维坐标数据文件, 取Y, X, H 三列, 将Command 后的point 命令改为Text 命令, 需要熟悉该命令参数设置, 可先在Aut oCAD J 标记在点的右边, (J (ML , 样式(S 一般为宋体。指定起点为点的平面坐标(Y

8、, X ;指定高度215; 指定文字的旋转角度0; 输入文字或直接回车。按要求选定好标注高程的字体样式、对正方式、大小及旋转角度后即可调用脚本文件, 标注高程的脚本文件格式为:。脚本文件内容示例如下:text J ML 49850184, 19299147115155text J ML 49855191, 19277128114188text J ML 49839163, 19298186115136text J ML 49839166, 19270142115119Text192981866" " " " " " 1151366&q

9、uot; (command"Text192701422" " " " " " 1151197" (command " " " " "498391637, 498391668,运行以上脚本文件, 则可标记整齐美观的各测点高程。同理, 如果需要展点号或展测点编码, 原理等同高程注记。只需将高程列改为点号或编码列, , " 格式点的样, 。113绘断面图(以横断面为例 设置点的样式为带圆心的小圆点, 实测横断面数据整理为(S i , H i 格式, 需按顺序从左

10、到右或从右到左依次排成两列。S i 表示测点距中桩(轴线 的距离, 左“一”右“十”, H i 为实测点高程, (S i , H i 等同于(Y, X 坐标。假定中桩轴线上某一设计整数高程值为H 0, (该整数高程最好在中桩设计高程附近 , 用Excel 处理后得到两列:S i 、H i , 把中桩轴线上整数高程(H 0 点定为操作基点。有两种方法:其一将各断面点展出, 然后逐一连线, 原理同上所述; 其二用" L ine" 命令编制脚本文件, 格式为:line S i , H i S i +1, H i +1。假定某一断面共有10个断面点数据(S i , H i 用Exc

11、el 编辑成如下:line S 1, H 1S 2, H 2line S 2, H 2S 3, H 3line S 3, H 3S 4, H 4用Excel 处理结果如图2所示 。line S 8, H 8S 9, H 9line S 9, H 9S 10, H 10point 0, H 0text J ML 0, H 0H 0Aut oL I SP 语言表达形式为:(command" L ine" " S i , H i " " S i +1, H i +1" " " 。脚本文件内容如下:图2用Excel 处理结

12、果(command"L ine" " S 1, H 1" " S 2, H 2" " " (command"L ine" " S 2, H 2" " S 3, H 3" " " Aut oL I SP 语言表达形式为:(command" Text" "Y, X" " " " " " H" 。脚本文件内容示例如下:Text192991473

13、" " " " " " 1151552" Text192771283" " " " " " 1141885" (command"(command"" " " "498501841, 498551915,(command"L ine" " S 8, H 8" " S 9, H 9" " " (command"L

14、 ine" " S 9, H 9" " S 10, H 10" " " (command" point" " 0, H 0" (command" Text" " 0, H 0" " " " " " H 0" 53 剪贴到文本编辑器中, 另存为纯文本脚本文件(31scr 即可。最后两行为绘制基点及标注基点高程。可作为绘制设计断面线、断面方格网和标尺高程注记的参考点。设计断面线可以以操作基点

15、为参考点应用相对坐标(Y,X ; “手工”在Aut ocad 中绘制或将设计断面分解成断面点数据自动绘图。也可将标准设计线连同断面格网和标尺做成标准图块插入绘制。基于Aut oC AD 2000中文版支持多文档操作和基点复制功能, 可根据打印机限定的图幅大小(如A3、A4 , 制作带标尺厘米格网的标准图框(出图比例1:1 , 其它文档上自动绘制的断面图, 通过“基点复制, , 用“ARE A ”命令, 用电子表格制作标准的方量计算表(关键在于错格合并, 单元格自动计算公式的输入 , 将断面的桩号、面积输入到计算表格, 通过公式自动计算方量。见示例图3。3结语上述方法可等同某些专业数字化成图软件

16、的类似功能, 相对传统手工模式则有质的飞跃, 而且简单易掌握、应用更加灵活。脚本文件可作为一个完整的绘图程序直接执行, , 使, 可直接读写原始数, 自动化程度更高。上述方法在云南小湾水电站对外公路第四标的测绘工作中得到很好的应用, 提高了绘图精度, 减少计算粗差的出现, 并使劳动效率得到较大提高。参考文献:1郭朝勇等1Aut oC AD14(中文版 二次开发技术M1北京:清华大学出版社1199912段红梅1Aut oCAD2000(中文版 自学教程M1北京:清华大学出版社119991作者简介:邱章云(1974- , 男, 湖南常德人, 工程师, 主要从事工程测量、数据处理、数字化制图等方面的

17、工作。图3示例(收稿日期:2005-01-06(上接第51页4结语大学出版社, 20011作者简介:王新生, 男, 山东淄博人, 现任山东金岭铁矿测量工程师, 主要从事工程测量、地形测量、地籍测量等测量工作。地形测量从白纸测图变革为数字测图, 测量的成果可供传输、处理、共享的数字地形信息, 即以计算机磁盘为载体的数字地形图, 这将成为信息时代不可缺少的地理信息的重要组成部分。参考文献:1高井祥等1数字测图原理与方法M1徐州:中国矿业(收稿日期:2005-01-1254ENGL I SH ABSTRACTS O F M A I N ART I CL ES I N TH I S I SSUEEst

18、ablish ment of the Res ources Envir onmentalMonit o 2ring Syste m in Fuxin M ining A rea -The paper illus 2trates the Res ources Envir on mental Monit oring Syste m in Fuxin m ining area established with the integrated technique of RS with GI S, and highlights es pecially the functi on and technol o

19、gical fl ow sheet of the syste m. The establishment of the syste m can p r ovide not only detailed data for envir on mental hazard harness and sustained devel opment of Fuxin m ining area but als o scientific reference f or leaders when they make deci 2si ons . (W ang Chongchang et al . Research on

20、Data Conversi on w and the JX -4-the paper t o on een EPSX2000and the -s olves the p r oble m of data conversi on bet w een the EPSX2000and the JX -4, makes it possible that the data of the EPSX2000and the JX -4can be shared on trans -p latf or m , and is easy t o understand and si m p le t o operat

21、e, is worth popularizing and utilizing in p r oducti on units . (Q iu Chunxia Design and Pr obe int o the Evaluati on Soft w are of GI S Spatial Data Quality -I n the paper, characteristics of the s patial data quality and the err or s ource and kinds of the s patial data are firstly described, and

22、then the design concep t of the data quality evaluati on s oft w are and the method t o design the database of the meta -data about data quality in accordance with current ac 2curacy evaluati on method are p r ovided . (Chen Junjie et al . Establish ment of the I M AGI S -based Three -D i m en 2si o

23、nal U rban V isualizati on Syste m -I n vie w of the characteristics of the I M AGI S and the syste m require 2ments, the three -di m ensi onal urban visualizati on is realized in the paper based on the t opographic map and re mote sensing i m age thr ough p rep r ocessing the t opographic map, gene

24、rating the three -di m ensi onal t opographic map, establishing the three -di m ensi onal model and mapp ing the texture . (Cheng Q ian et al . Si m p le D iscussi on on Several Pr oble m s of the GPS D ifference Method in Actual U se in M ining A rea -The paper elaborates the methods how t o measur

25、e ac 2curately the W GS -84coordinate of the reference sta 2ti on and how t o s olve the para meters converted fr om the W GS -84coordinate t o the l ocal coordinate s o as t o realize the GPS difference measure ment in the m in 2ing area where the GPS is firstly used t o make differ 2ence measure m

26、ent . (W ang Guoying et al . thRealizati on of Conversi on fr o m the 54Coordinate t oththe 80Coordinate by U sing the Quadratic Polynom ial -The Beijing Coordinate Syste m in 1954and the Xian Coordinate System in 1980are t w o kinds of coordi 2nate syste m s kep t in the map document p resently in

27、China . I n the paper, a test using the quadratic poly 2thnom ial method t o make conversi on fr om the 54coordi 2thnate t o the 80coordinate is done, which is p r oved bythe operati onal analysis t o be effective for the coordi 2nate conversi on of the s patial data in certain regi ons . (W ang J i

28、andi et al . The Method of Laying Traverses t o Reduce the Thr ough Err or of the Extra -l ong Tunnel -The paper analyses main fact ors affecting the lateral thr ough err or of the extra -l ong tunnel . Si m ultaneously s ome ne w methods and acti ons t o positi on points and the ol fra f or ward an

29、d s ome made are given . (et al . Pl otting by U sing the Excel t ile the Scri p t Document of the Aut oCAD -I n the paper, using the scri p t document (3. scr of the Aut oCAD as batch p r ocessing p r ogra m t o realize s ome functi ons including aut omatic batch points p l otting, height marking a

30、nd cr oss secti on drafting etc . based on the Excel data p r ocessing t ool is elaborated, which can rep lace original hand drafting and has relatively good p ractical significance . (Q iu Zhangyun Aut oCAD -based Aut o matic Calculati on of the Road Survey Data -Many diagra m s and data tables are

31、 re 2quired t o be treated in the reconnaissance survey and design of r oads, while the traditi onal method is t o draft by hand, which not only wastes labor power but als o p r ol ongs the design ti m e . The paper illustrates a ne w method of using the VB and CAD p r ogra m s t o realize aut o mat

32、ic drafting of p lan vie w of the r oads and tables of every p ile coordinate, which is p r oved by p ractice t o be si m p le and p ractical, can use manpower and ma 2terial res ources s paringly, i m p r ove working efficiency and accuracy, and lay a f oundati on f or r oad survey . (Zhang J inyu et al . Ref or m and Practice of Practical Teaching of Engineer 2ing Survey -The engineering survey is main technol o 2gy of the engineering constructi on and basic technol ogy for civil engine

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论