应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc

上传人:laozhun 文档编号:2388552 上传时间:2023-02-17 格式:DOC 页数:4 大小:4.12MB
返回 下载 相关 举报
应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc_第1页
第1页 / 共4页
应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc_第2页
第2页 / 共4页
应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc_第3页
第3页 / 共4页
应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc》由会员分享,可在线阅读,更多相关《应用Excel编制AutoCAD脚本文件实现批量展点绘图.doc(4页珍藏版)》请在三一办公上搜索。

1、应用Exce l编制 A u toCAD 脚本文件实现批量展点绘图邱章云(葛洲坝股份公司测绘总队 ,湖北 宜昌443002 )摘要 :文中介绍了以 Exce l作为数据处理工具 ,应用 A u toCAD 中脚本文件 ( 3 . sc r)作为批处理程序实现自动批量展点 、标注高程 、绘制断面图等功能 。以此代替原始的手工绘图 ,具有较好的现实意义 。关键词 : A u toCAD; Exce l; 数字化成图 ; 脚本文件 ; 批量展点绘图中图分类号 : TB 23文献标识码 : B文章编号 : 1001 - 358X ( 2005 ) 03 - 0052 - 03应 A、B、C、D、E 各

2、 列 , 只 采 用 Y 坐 标 ( C ) , X 坐 标(D )两列 ,在任意空白列相对应的单元格如 G1 中输 入文本合并公式 : = po in t & C1 & , & D1 , 内为公式表达式 ,用鼠标拖动填充柄经过待填充区 域 ,既得到脚本文件所需文本 ,见图 1: (为保留小数点后两位 ,采用了“L EFT”函数 。)在一些诸如隧洞 、公路 、铁路建设工程项目中 ,如果工程技术人员具有一定的 A u toCAD 和 Exce l基 础 ,即可以实现“自己的 ”批量展点绘图及电子表格 自动计量 ,从而摆脱传统手工绘图和手工量算面积 计量带来的诸多不便 。A u toCAD 和 E

3、xce l是目前国内外使用非常广泛 的 CAD 绘图和 office办公软件 。当前最流行的版本 是 A u toCAD 2000 和 Exce l 2000 中文版 。可 以把 一 系列需要重复使用的 A u toCAD 绘图命令和参数编写 成脚本文件 。脚本文件是 A SC II码 文本 文件 , 类 型为 3 . sc r,可在任意文本编辑器中编写构成一命令序 列 ,相当于一个程序 。在 A u toCAD 中用 sc rip t命令 测试和运行此文件 ,即可按指定顺序执行这些命令 (类似于 DO S系统中的批处理功能 ) 。编写脚本文 件的格式规则主要为 :空格即代表回车 ,不得随意增

4、减空格 ,须清楚所用 A u toCAD 绘图命令及参数的使 用情况 ,本文示例中均以“”表示空格 ;字母大小写 不限 ,但空格或双引号等符号须在英文标点状态下 输入 。所介绍的批量展点绘图主要以脚本文件 ( 3 . sc r)为主来实现 。图 1 脚本文件所需文本将该列文本内容剪贴到 wo rd 或者记事本中 ,另 存为纯文本文件 ,扩展名为 sc r,文件内容示例如下 :po in t49850184 , 19299147 po in t49855191 , 19277128 po in t49839163 , 19298186 po in t49839166 , 192701421 A

5、u toCAD 批量展点绘图此外 ,还可以采用 A u toL ISP语言的表达形式 ,其标准格式为 : ( comm and po in t Y, X ) 。用 Exce l 处 理 : 插 入 两 列 如 L、M 列 , 内 容 为 ( comm and po in t 和 ) , 内 为 单 元 格 填 充 内容 ,在另空白列 N 相应单元格中输入文本合并公 式 : = L1 & C1 & , D1 &M 1 ,用鼠标拖动填充柄经 过待填充区域 ,后得到如下文本 :( comm and po in t 49850184 , 19299147 ) ( comm and po in t 49

6、855191 , 19277128 ) ( comm and po in t 49839163 , 19298186 )需掌握 三个 A u toCAD 命 令 : 展点 po in t ; 写 文字 text ;画直线段 line 。111 展点其脚本文件 格 式 为 : po in tY, X。如 测 了 一 段 公路的带 状 地 形 , 将 野 外 采 集 的 原 始 数 据 按 A u to2CAD 默认的绘图设置 (数学坐标系 ) 编辑成三维坐标数据格式 (点号 , 编 码 , Y, X, H ) , 存为 文本 文 件 。 在 Exce l中打开该文件 , 点号 、编码 、Y、X、

7、H 分别对计算机应用( comm and po in t 49839166 , 19270142 )(498391637 ,comm andText 192981866 1151366 )(498391668 ,同理存为扩展名为 sc r的纯文本脚本文件 。以上脚本文件 ( 3 1 sc r) 生成后 , 在 A u toCAD 菜 单 too ls中调用 R un sc rip t111 命令 ,或直接在命令行中输入 sc rip t , 弹出打开文件对话框 , 选定 刚 生成的 3 1 sc r文件 ,即可完成绘图 ,以下类同 。112 标注高程如需要展测点高程 ,则用 Exce l打开上

8、述三维坐 标数据文件 ,取 Y, X, H 三列 ,将 Comm and后的 po in t命令改为 Text命令 ,需要熟悉该命令参数设置 ,可先 在 A u toCAD 中运行该命令进行调试 :指定文字起点或对正 ( J ) /样式 ( S) :一般高程 标记在点的右边 ,故“对正 ( J )的选项为左中 (ML ) , 样式 ( S) 一 般 为 宋 体 。指 定 起 点 为 点 的 平 面 坐 标( Y, X) ;指定高度215 ;指定文字的旋转角度0 ;输入文字或直接回车 。 按要求选定好标注高程的字体样式 、对正方式 、大小及旋转角度后即可调用脚本文件 ,标注高程的 脚本文件格式为

9、 : textJ ML Y, X H。脚本comm andText 192701422 1151197 )运行以上脚本文件 ,则可标记整齐美观的各测点高程 。同理 ,如果需要展点号或展测点编码 ,原理 等同高程注记 。只需将高程列改为点号或编码列 , 而点的样式和大小可根据需要进行改变以示区别 ,通过运行 DD PTYPE 或 菜 单 命 令“格 式 点 的 样 式 ”来设置 。此外 ,将展点和标注高程脚本文件合并为一个文件则可一次性展高程点 。113 绘断面图 (以横断面为例 )设置点的样式为带圆心的小圆点 , 实测横断面 数据整理为 ( Si , Hi )格式 ,需按顺序从左到右或从右到左

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

11、i )用 Exce l编辑成如下 : lineS1 , H1 S2 , H2 lineS2 , H2 S3 , H3 lineS3 , H3 S4 , H4 文件内容示例如下 :textJ ML 49850184 , 19299147 115155 textJ ML 49855191 , 19277128 114188textJ ML 49839163 , 19298186 115136 textJ ML 49839166 , 19270142 115119用 Exce l处理结果如图 2所示 。lineS8 , H8 S9 , H9 lineS9 , H9 S10 , H10 po in t

12、0 , H0textJ ML 0 , H0 H0A u toL ISP 语 言 表 达 形 式 为 : ( comm and L ine Si , Hi Si + 1 , Hi + 1 ) 。脚本文件内容如下 :( comm and L ine S1 , H1 S2 , H2 ) ( comm and L ine S2 , H2 S3 , H3 )图 2 用 Exce l处理结果A u toL ISP语 言 表 达 形 式 为 : ( comm and Text Y, X H ) 。脚本文件内容示例如下 :( comm and L ine S8 , H8 S9 , H9 )( comm and

13、 L ine S9 , H9 S10 , H10 ) ( comm and po in t 0 , H0 )( comm and Text 0 , H0 H0 )(498501841 ,comm andText 192991473 1151552 )(comm andText 498551915 ,192771283 1141885 )53量计算表 (关键在于错格合并 ,单元格自动计算公式的输入 ) ,将断面的桩号 、面积输入到计算表格 ,通过 公式自动计算方量 。见示例图 3。剪贴到文本编辑器中 , 另存为纯文本脚本文件( 3 1 sc r)即可 。最后两行为绘制基点及标注基点高 程 。可作

14、为绘制设计断面线 、断面方格网和标尺高 程注记的参考点 。设计断面线可以以操作基点为参考点应用相对坐标 ( Y, X) ;“手工 ”在 A u tocad中绘制或将设计断 面分解成断面点数据自动绘图 。也可将标准设计线 连同断面格网和标尺做成标准图块插入绘制 。基于 A u toCAD 2000中文版支持多文档操作和基点复制功 能 ,可根据打印机限定的图幅大小 (如 A3、A4 ) ,制作 带标尺厘米格网的标准图框 (出图比例 1: 1 ) ,可将在 其它文档上自动绘制的断面图 ,以基点按比例缩放后 通过“基点复制 ”这项功能复制到标准图框中 ,再根据 断面比例标注标尺高程值 、添加设计线 ,

15、用“AR EA ”命 令 ,求该断面的实际面积 。用电子表格制作标准的方3 结语上述方法可等同某些专业数字化成图软件的类似功能 ,相对传统手工模式则有质的飞跃 ,而且简单 易掌握 、应用更加灵活 。脚本文件可作为一个完整 的绘图程序直接执行 ,也可以作为菜单文件调用 ,使 操作更为简化 。同时如果你有一定的编程基础 , 可以用任一种高级语言 (如 VB、VC ) 直接读写原始数 据以生成所需要的脚本文件 ,自动化程度更高 。上 述方法在云南小湾水电站对外公路第四标的测绘工 作中得到很好的应用 ,提高了绘图精度 ,减少计算粗 差的出现 ,并使劳动效率得到较大提高 。参考文献 : 1 郭朝勇等 1

16、 A u toCAD14 (中文版 ) 二次开发技术 M 1北京 :清华大学出版社 119991 2 段红梅 1 A u toCAD2000 (中文版 )自学教程 M 1北京 :清华大学出版社 119991作者简介 :邱章云 ( 1974 - ) ,男 ,湖南常德人 ,工程师 ,主要从事工程测量 、数据处理 、数字化制图等方面的工作 。图 3 示例(收稿日期 : 2005 - 01 - 06 )(上接第 51页 )大学出版社 , 200114 结语作者简介 :王新生 ,男 , 山东淄博人 , 现任山东金岭 铁矿测量工程师 ,主要 从 事 工 程 测 量 、地 形 测 量 、地 籍 测 量 等

17、测 量 工地形测量从白纸测图变革为数字测图 , 测量的成果可供传输 、处理 、共享的数字地形信息 , 即以计 算机磁盘为载体的数字地形图 ,这将成为信息时代 不可缺少的地理信息的重要组成部分 。作 。 (收稿日期 : 2005 - 01 - 12 )参考文献 : 1 高井祥等 1数字测图原理与方法 M 1徐州 :中国矿业ENGL ISH A BSTRAC TS O F M A IN A RT ICL ES IN TH IS ISSUEE stab lishm en t of the R e sou rce s Environm en ta l Mon ito2ring System in Fu

18、xin M in ing A rea - The p ap e r illu s2 tra te s the R e sou rce s Environm en ta l Mon ito ring System in Fuxin m in ing a rea e stab lished w ith the in tegra ted techn ique of R S w ith G IS, and h igh ligh ts e sp ec ia lly the func tion and techno logica l flow shee t of the system. The e sta

19、b lishm en t of the system can p rovide no t on ly de ta iled da ta fo r environm en ta l haza rd ha rne ss and su sta ined deve lopm en t of Fuxin m in ing a rea bu t a lso sc ien tific refe rence fo r leade rs when they m ake dec i2 sion s. (W ang Chongchang e t a l. )R e sea rch on D a ta Conve r

20、sion be tween the EPSX2000 and the JX - 4 - The temp la te techn ique is u sed in the p ap e r to d iscu ss the da ta conve rsion be tween the EPSX2000 and the JX - 4 , wh ich so lve s the p rob lem of da ta conve rsion be tween the EPSX2000 and the JX- 4 , m ake s it po ssib le tha t the da ta of t

21、he EPSX2000 and the JX - 4 can be sha red on tran s - p la tfo rm , and is ea sy to unde rstand and simp le to op e ra te, is wo rth pop u la rizing and u tilizing in p roduc tion un its. ( Q iu Chunxia)D e sign and P robe in to the Eva lua tion Softwa re of G IS Sp a tia l D a ta Q ua lity - In the

22、 p ap e r, cha rac te ristic s of the sp a tia l da ta qua lity and the e rro r sou rce and k ind s of the sp a tia l da ta a re firstly de sc ribed, and then the de sign concep t of the da ta qua lity eva lua tion softwa re and the m e thod to de sign the da taba se of the m e ta - da ta abou t da

23、ta qua lity in acco rdance w ith cu rren t ac2 cu racy eva lua tion m e thod a re p rovided.( Chen J un jie e t a l. )E stab lishm en t of the IMA G IS - ba sed Th ree - D im en2siona l U rban V isua liza tion System - In view of the cha rac te ristic s of the IMA G IS and the system requ ire2 m en

24、ts, the th ree - d im en siona l u rban visua liza tion is rea lized in the p ap e r ba sed on the topograp h ic m ap and remo te sen sing im age th rough p rep roce ssing the topograp h ic m ap , gene ra ting the th ree - d im en siona l topograp h ic m ap , e stab lish ing the th ree - d im en sio

25、na l mode l and m app ing the textu re. ( Cheng Q ian e t a l. ) Simp le D iscu ssion on Seve ra l P rob lem s of the GPS D iffe rence M e thod in A c tua l U se in M in ing A rea - The p ap e r e labo ra te s the m e thod s how to m ea su re ac2 cu ra te ly the W GS - 84 coo rd ina te of the refe r

26、ence sta2 tion and how to so lve the p a ram e te rs conve rted from the W GS - 84 coo rd ina te to the loca l coo rd ina te so a s to rea lize the GPS d iffe rence m ea su rem en t in the m in2 ing a rea whe re the GPS is firstly u sed to m ake d iffe r2 ence m ea su rem en t. (W ang Guoying e t a

27、l. )the op e ra tiona l ana lysis to be effec tive fo r the coo rd i2na te conve rsion of the sp a tia l da ta in ce rta in region s. (W ang J iand i e t a l. )The M e thod of L aying Trave rse s to R educe the Th rough E rro r of the Extra - long Tunne l - The p ap e r ana lyse s m a in fac to rs a

28、ffec ting the la te ra l th rough e rro r of the extra - long tunne l. Sim u ltaneou sly som e new m e thod s and ac tion s to po sition trave rse po in ts and su rvey the con tro l fram ewo rk a re p u t fo rwa rd and som e sugge stion s when the ac tua l su rvey is m ade a re givena s we ll in the

29、 p ap e r. (W ang X iaohong e t a l. )R ea liza tion of B a tch Po in ts P lo tting by U sing the Exce l to Comp ile the Sc rip t Docum en t of the A u toCAD - In the p ap e r, u sing the sc rip t docum en t ( 3 . sc r) of the A u toCAD a s ba tch p roce ssing p rogram to rea lize som e func tion s

30、inc lud ing au tom a tic ba tch po in ts p lo tting, he igh t m a rk ing and c ro ss sec tion d rafting e tc. ba sed on the Exce l da ta p roce ssing too l is e labo ra ted, wh ich can rep lace o rigina l hand d rafting and ha s re la tive ly good p rac tica l sign ificance. (Q iu Zhangyun)A u toCAD

31、 - ba sed A u tom a tic Ca lcu la tion of the Road Su rvey D a ta - M any d iagram s and da ta tab le s a re re2 qu ired to be trea ted in the reconna issance su rvey and de sign of road s, wh ile the trad itiona l m e thod is to d raft by hand, wh ich no t on ly wa ste s labo r powe r bu t a lso p

32、ro longs the de sign tim e. The p ap e r illu stra te s a new m e thod of u sing the VB and CAD p rogram s to rea lize au tom a tic d rafting of p lan view of the road s and tab le s of eve ry p ile coo rd ina te, wh ich is p roved by p rac tice to be simp le and p rac tica l, can u se m anpowe r an

33、d m a2 te ria l re sou rce s sp a ringly, imp rove wo rk ing effic iency and accu racy, and lay a founda tion fo r road su rvey.( Zhang J inyu e t a l. )R efo rm and P rac tice of P rac tica l Teach ing of Enginee r2 ing Su rvey - The enginee ring su rvey is m a in techno lo2 gy of the enginee ring

34、con struc tion and ba sic techno logy fo r c ivil enginee ring techn ic ian s to unde rtake techn ica l wo rk of enginee ring con struc tion, the refo re, to lea rn and gra sp fundam en ta l theo ry and techn ique of engi2 nee ring su rvey cou rse s is ba sic cond ition fo r c ivil engi2 nee ring te

35、chn ic ian s to go in fo r mode rn enginee ring con struc tion. Sta rting from the teach ing ta rge t and re2 qu irem en t of the studen ts in c ivil enginee ring dep a rt2 m en t lea rn ing the su rvey, the p ap e r illu stra te s the p rac tica l teach ing con ten t stre ssing m ap u se and con2 s

36、truc tion su rvey, ana lyse s the p rac tica l teach ing mode in new situa tion and sugge sts to e stab lish un ifo rm ex2 p e rim en ta l p rac tice ba se s. In add ition, com b ina tion of conduc ting p rac tica l teach ing wo rk w ith m ak ing voca2 tiona l sk ill tra in ing and rea liza tion of

37、c lo se link be2 tween exp e rim en t and p rac tice th rough op en ing com 2 p le te ly the labo ra to ry and p rac tica l teach ing tim e a re p roved to be refo rm ac tion s and exp e rience of p rac tica l teach ing, and have refe rence va lue to som e degree fo r p rac tica l teach ing of engin

38、ee ring sp ec ia lized cou rse s.( Zhao B aofeng)R ea liza tion of Conve rsion from the 54th Coo rd ina tetothe 80th Coo rd ina te by U sing the Q uad ra tic Po lynom ia l- The B e ijing Coo rd ina te System in 1954 and the X ian Coo rd ina te Systemna te system s kep t inCh ina. In the p ap e r,in 1980 a re two k ind s of coo rd i2the m ap docum en t p re sen tly in a te st u sing the quad ra tic po ly2nom ia l m e thod to m ake conve rsion from the 54th coo rd i2na te to the 80th coo rd ina te is done, wh ich is p roved by

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号