1、利用VB对CAD的二次开发技术绘制地层剖面柱状图(1)邓巍(陕西省煤田地质局一八五队,陕西榆林719000)时间:2010-12-289:59:04点击:542摘要:地质勘探工程技术人员在绘图时,常使用重复的手工作业,不但乏味而且工作效率低,绘图精度不高而且容易出现错误。利用vb对cad的开发技术,可以为广大工程绘图人员提供更加简洁、快速、高效的制图技术和方法。关键词:vb;autocad;二次开发;地层剖面柱状图中图分类号:tp391.72 文献标识码:a 文章编号:1007-9599 (2010) 13-0000-02using v
2、b as the secondary development of cad technology to draw histogram stratigraphic sectiondeng wei(shaanxi coalfield geology bureau,185 troop,yulin 719000,china)abstract:the geotechnical engineering and technical personnel in the drawing,often with repetitive manual work,no
3、t only tedious and low efficiency,mapping accuracy is not high and prone to error.using vb for development of cad technology to provide engineering drawings for the majority of more compact,fast and efficient mapping technology and methods.keywords:vb;autocad;secondary dev
6、的思路是:按照用户输入的厚度和底板深度值及用户选择的地层符号,按照一定的纵向比例尺在autocad中自动绘图,生成地层剖面柱状图。(如下图)二、程序界面程序开发前首先,引用autocad2004 type library:在vb中选择“工程”→“引用”,在“引用”对话框中选择autocad2004 type library。其次,为应用程序(acadapp)和当前文档(acaddoc)分别定义变量,通常定义为全局变量。代码如下:dim acadapp as acadapplicationdim acaddoc as acaddocument
7、然后设计vb界面,包括柱子名称、柱子宽度、偏移量、纵向比例、岩性、厚度、底板深度等输入及选择项目,设置在cad中绘图、显示cad、关闭cad、保存文件、退出等按钮。(如下图)三、程序代码dim acadapp as acadapplicationdim acaddoc as acaddocumentprivate sub command1_click()’标注孔号dim textobj as acadtextdim textstring as stringdim insertionpoint(0 to 2) as doubledim hei
8、ght as double textstring=text1.text insertionpoint(0)=0 insertionpoint(1)=5 i