资源描述
专题部分保护煤柱绘制软件的开发与应用摘要 本软件基于 Visual Basic 6.0 并联合 Excel、Auto CAD 开发的绘制斜井井筒、立井井筒、急倾斜煤层群立井井筒、建筑物及工业广场保护煤柱的图形自动化绘制软件,并给予精确的定位,在矿井设计和改造中避免了烦琐而复杂的工作,具有一定的实用性。关键词:保护煤柱 CAD 二次开发 VB Excel 自动绘图1.概述Mcrosoft 公司的 Visual Basic6.0 是当今最畅销的编程语言之一,简单易学,功能强大,人机对话方便,程序运行调试方便,得到了广泛的应用。Autodesk 公司的 AutoCAD 是当今世界上最畅销的绘图软件之一,已成为广大工程技术人员最好的设计助手。它具有强大的绘图功能,同时,具有开放性,用户可以根据自己的实际需要及专业性质,对 CAD 进行二次开发,从而更加完善地为本专业服务,这也是 CAD 受欢迎的重要原因之一。目前,计算机在采矿领域的应用应用已越来越广,其中一个重要的应用方向就是计算机辅助制图(CAD) 。在煤炭行业,CAD 的应用已相当普遍,但制图自动化程度较低,工作量大,生产、设计单位也缺少这方面的软件,由此给我们一个思路,通过编程实现绘图的自动化。CAD 内部的 VBA 开发工具,使以上两套功能强大的软件可以无间隙地结合在一起,让用户可以自主开发出专业方向软件。为此采用 AutoCAD 的ActiveX 技术及 Visual Basic 6.0、Mcrosoft Excel 编制软件。2.原理2.1 地下开采破坏了岩体内部原有的力学平衡状态,使上覆岩层不同程度地变形和破坏。当开采面积达到一定范围之后,起始采场附近的岩层移动和变形将扩展到地表,此时的地表移动和变形将影响到位于开采影响范围内的房屋建筑、工程、河流、湖泊、铁路及管线,会改变它们原有的状态,甚至破坏。同样,在移动岩体内的井巷也可能受到开采影响而遭受破坏。当地下开采将影响到上覆岩层及地表,并且其产生的变形有可能危及岩体内的井巷或者地表的建筑物和构筑物正常使用时,最常用和最可靠的方法就是在需要保护的井筒、建筑物或构筑物下方留一部分实体煤不采或暂时不采,所留煤柱的面积应使周围煤炭开采时对保护对象不产生有危险性的移动和变形。为保护地貌、地面工业场地、地面建筑物、铁路、堤坝等而留下来的实体煤称为建筑物或构筑物的保护煤柱。2.2 垂直剖面法设计保护煤柱原理垂直剖面法是作图的方法,作沿煤层走向和倾向的剖面,在剖面图上由移动角确定煤住宽度,并投影到平面图上,得到保护煤柱边界。作图前所需的资料为:松散层和基岩移动角;煤层底板等高线图;并田地质剖面团;井上下对照图。以图 1 为例,说明用垂直剖面法设计保护煤柱的步骤,图中的煤层底板等高线标高是为了说明作图方法所加的。 C(k )mA(q )-350 m23 B(q )D(k )-250 -20-150cbda n22nm2 1h12 3q 21qkh1-305k-1052图 1 垂直剖面法设计保护煤柱(1)在煤层底板等高线图上,过要保护的建筑物或建筑物群最外角点,作平行于煤层走向和倾向的四条直线,交 a、b 、c和 d,形成矩形。(2)按建筑物保护等级在矩形 a、b、c和 d四周加相应宽度的围护带,形成地表保护范围 a、b、c 、d ,地表要保护范围的边界为 mn 和 qk。(3)过 a、d 或 b、c 中点,作沿煤层倾向的剖面 II。(4)将煤层底板等高线、上覆岩层和要保护的建筑物边界投影到平行于煤层走向的垂面内,形成所谓的投影面。(5) I 一 I 和面上,过 m、n 和 q、k 四点,按松散层移动角 划线与基岩相交于、 和 、 ;在 II 剖面上,过 和 两点,按下山移动角 和上山移1mn1qk1 动角 画线与煤层交于 和 。2mn在剖面上,过 和 点按走向移动角 划线,与煤层相交于与 线1qk2n同标高的 和 ,与 同标高的 和 。2qk232m(6)将 和 及 、 、 和 投影到煤层底板等线图上,得n32kA、B、C 、D 四点,连接 A、B、C 和 D,即得平面图上的保护煤柱边界。在平面图上用垂直剖面法设计的保护煤柱形状是对称的梯形,梯形的长边和短边平行于煤层走向,因扩大了地表保护范围,在开采影响下地表建筑物安全性较高。为了提高精度,在沿煤层倾向的剖面上,垂直剖面法所留的保护煤柱尺寸还可以由计算方法得到,计算结果如(1)式。 ()cotantaAHhq(式 1)Bl反斜井井筒及工业广场保护煤柱绘制急倾斜煤层群立井井筒保护煤柱绘制立井井筒保护煤柱绘制2.3 立井井筒保护煤柱的设计某矿立井井筒的地质条件及冲积层和基岩移动角值见表 1。保护煤柱边界的圈定如下(图 2):图 2 立井井筒保护煤柱的圈定表 1 某矿立井井筒地质条件及冲积层和基岩移动角值井筒垂深H(m)煤层厚度M(m)煤层倾角( )()() ( )()冲积层厚度h(m)300 2 20 45 70 60 70 20(1)通过立井井筒中心沿煤层倾向和走向分别作剖面 II 和,按 I 级保护建筑物在井筒周围留 20m 宽的围护带,在剖面图上得 m,n 及 k,l 各点。(2)根据冲积层和基岩的移动角值,绘出保护煤柱的边界线,在剖面 II上得 , 点。 在剖面上得 , 点。1mn1kl(3)将 、 、 、 各点投影到平面图上,得 、 、 、 点。过 、1k1l 2mn2l2m点分别作走向平行线,井截取线段 和 分别等于 和 gh,得梯形2 lgh1k1k。连接对角线 O , O ,O 自 O 。1lghg1(4)以井简中心 O 为原点,分别以 O 、O 、O 、O 为半径画圆弧,井2k2l交于对角线上;在对角线上取两圆弧与之相交的中点,得 P,Q,R,S。(5)用圆滑曲线连接 、P、 、Q、 、R、 、S 各点,即为立井井简保2m2k2n2l护煤柱的边界。2.4 急倾斜煤层群立井井筒保护煤柱设计某矿开采急倾斜煤层群,煤层倾角 68,各煤层厚度及间距如图 4。立井井筒位于煤系地层底板,其参数为 45, 75, 55。保护煤柱边界圈定方法如下(图 3): 图 3 急倾斜煤层群立井保护煤柱的圈定(1)过工业场地角点作平行煤层走向和倾向的直线得四边形 1234。在四边形外围留 20m 宽围护带,得受护面积边界 1234。(2)在过井筒中心的倾向剖面即 A 一 B 剖面上,过 M 点以 45作直线,交基岩面上 m 点;由 m 点以 55作直线,分别交 和 煤层于 S 和 t 点,则1m2此两点分别为两个煤层的开采下限。mst 直线及矿井设计深度以内所有煤层均为倾向剖面上的保护煤拄。(3)在过井筒中心的走向剖面即 CD 别面上,由 P、Q 两点以 45作直线,交于基岩面 p、q 点;由 p、q 两点以 78作直线,两直线与设计深度所圈定的煤层,为走向剖面上的保护煤柱。(4)在平面图上 65 为 煤层保护煤柱边界; 87 为 煤层保护煤柱1t21m12s2m边界 pq910 为 煤层保护煤柱边界,等等。32.5 反斜井井筒及工业场地保护煤柱设计某矿反斜井地质条件及冲积层和基岩移动角值如表 2。保护煤柱边界圈定方法如下(图 4):表 2 某矿反斜井井筒地质条件和基岩移动角值斜井斜长L( m)斜井倾角()煤层倾角( )煤层厚度M(m)冲积层厚度(m)()()()()415 23 11 2.2 15 45 75 75 70图 4 反斜井井筒及工业场地保护煤柱的圈定(1)在工业场地边界外侧留 15m 宽的围护带;在斜井两侧留 20m 宽的围护带,得受护面积边界 。1abecd(2)过斜井轴线作倾向剖面 A 一 B。由工业场地受护边界 、 点以1ab 45作直线与基岩面相交,由交点分别以 75和 70作直线,与 煤层底板相交分别得 、 点。1ab煤层与井筒在 e 点相交。由并底车场巷道顶板到煤层底板的垂高不应小于高度 。 30 一 30 一 25(m)。从而确定得煤层底板上的sh251257.3q 点。式中 30、25 均为回归的常数; 为煤层倾角; 为斜井落底处井底的曲线半径。井口 在煤层上的垂直投影点 为斜井井筒保护煤柱下边界(当只留斜井保0h1h护煤柱时,仍由井口受护面积边界点按移动角圈定)。为倾向剖面上工业场地保护煤柱边界。1ab为倾向剖面上斜井和井底车场保护煤柱边界。hg(3)在走向剖面 CD 上,由 、 点以 45作直线与基岩面相交,由pq交点以 75作直线,与倾向剖面上 、 点的投影线分别相交于点 、1ab2a,和 、 。 和 为走向剖面上工业广场保护煤柱边界。2ab2a2b2斜井井筒受护面积边界和倾向剖面上 g、e 点的投影线相交于点 、 和1g、 。 和 ,为走向剖面井底车场保护煤柱边界。1e1g1e由井口受护面积边界以 45作直线,与基岩面相交,由交点以 75作直线,与倾向剖面上 点的投影线分别相交于点 、 。连接1h2h和 ,与 分别相交于点 和 。12h12b23b(4)将 、 、 、 、 、 、 、 、 、 点投影到平面团上,a 1e1g则 即为反斜井及工业场地保护煤柱边界。3eg13a2.6 Visual Basic 与 Auto CAD 的连接Visual Basic 语言对 AutoCAD 的二次开发,就要使 Visaul Basic 的程序能调用CAD 的命令并能在 CAD 的环境下由程序控制进行自动绘图。首先在 Visaul Basic 模块中申明一组对象。Public ACADApp As Object 定义 AutoCAD 对象Public AcadDoc As ObjectPublic AcadMds As ObjectPublic AcadUtil As ObjectPublic Sub QiDongCad() 连接 CADOn Error Resume NextSet ACADApp = GetObject(, “AutoCAD.AppliCAtion“)If Err ThenErr.ClearSet ACADApp = CreateObject(“AutoCAD.AppliCAtion“)End IfSet AcadDoc = ACADApp.ActiveDocumentSet AcadMds = AcadDoc.ModelSpaceSet AcadUtil = AcadDoc.UtilitySet AcadPaperSpace = AcadDoc.PaperSpaceACADApp.Visible = True2.7 Visual Basic 与 Excel 的连接Visual Basic与 Excel 的连接同Visual Basic与AutoCAD 的连接,要使Visaul Basic的程序能调用Excel 的命令、函数等,并在Excel中存取数据,首先要在Visaul Basic模块中申明一组对象。Public ExcelApp As Object 定义EXCEL空间Public ExcelWBook As ObjectPublic ExcelWSheet As ObjectPublic ExcelShape As Excel.ShapesPublic ExcelChart As Excel.ChartPublic Excel_Name As StringPublic Paint_Name As StringPublic Sub QiDongExcel() 连接EXCELOn Error Resume Next 忽略错误Set ExcelApp = GetObject(, “Excel.Application“) 查找一个正在运行的Excel 拷贝If Err Then 如果 Excel 没有运行则运行它Err.ClearSet ExcelApp = CreateObject(“Excel.Application“) End IfEnd Sub2.8 自定义变量类型Public M(0 To 2) As DoublePublic N(0 To 2) As DoublePublic M1(0 To 2) As DoublePublic N1(0 To 2) As DoublePublic M2(0 To 2) As DoublePublic N2(0 To 2) As DoublePublic R(0 To 2) As DoublePublic l(0 To 2) As DoublePublic R1(0 To 2) As DoublePublic L1(0 To 2) As DoublePublic R2(0 To 2) As DoublePublic L2(0 To 2) As DoublePublic R3(0 To 2) As DoublePublic L3(0 To 2) As DoublePublic A(0 To 2) As DoublePublic B(0 To 2) As DoublePublic C(0 To 2) As DoublePublic D(0 To 2) As DoublePublic A1(0 To 2) As DoublePublic B1(0 To 2) As DoublePublic C1(0 To 2) As DoublePublic D1(0 To 2) As DoublePublic A2(0 To 2) As DoublePublic B2(0 To 2) As DoublePublic C2(0 To 2) As DoublePublic D2(0 To 2) As DoublePublic II1(0 To 2) As DoublePublic II2(0 To 2) As DoublePublic II3(0 To 2) As DoublePublic II4(0 To 2) As DoublePublic II5(0 To 2) As DoublePublic II6(0 To 2) As DoublePublic JiAo1 As DoublePublic JiAo2 As DoublePublic JiAo3 As DoublePublic JiAo4 As DoublePublic JiAo5 As DoublePublic BJiao1 As DoublePublic BJiao2 As DoublePublic BJiao3 As DoublePublic BJiao4 As DoublePublic BJiao5 As DoublePublic HouDu As DoublePublic H1 As DoublePublic H2 As DoublePublic HHY1 As DoublePublic HHY2 As DoublePublic MeiMiDu As Double2.9 画图过程3 使用说明3.1 运行将文件“PillarDesign.exe”与含有其它 6 个程序的文件夹“app”放置在电脑同一地址下。双击“PillarDesign.exe”图标,出现运行窗口(图 5):图 5 PillarDesign 软件运行界面点击“进入” ,有一个两秒钟的提示页面:图 6 提示页面图 7 PillarDesign 软件运行主界面此时点击 6 个程序的任一按钮,将调用出该程序的数据采集界面(图 8):3.2 软件使用图 8 数据采集页面在各项文本框中输入实际参数后,点击“垂直剖面法绘制”按钮,软件将调用AutoCAD 和 Excel,实现自动化绘图和精确数据输出(图 9,图 10,图 11):图 9 AutoCAD 绘制结果图 10 Excel 运行结果图 11 程序运行成功提示3.3 退出软件退出较简单,每一程序界面都有“退出”按钮,点击即可安全退出图 12 程序退出参 考 文 献1 徐永忻.采矿学.徐州:中国矿业大学出版社,20032 徐永忻.煤矿开采学.徐州:中国矿业大学出版社,19993 林在康、左秀峰.矿业信息及计算机应用. 徐州:中国矿业大学出版社,20004 戴绍城.高产高效综合机械化采煤技术与装备.北京:煤炭工业出版社,19975 陈炎光、徐永祈.中国采煤方法.徐州:中国矿业大学出版社,19916 钱鸣高、刘听成.矿山压力及控制. 北京:煤炭工业出版社,19917 于海勇.放顶煤开采的基础理论. 北京:煤炭工业出版社,19958 王省身.矿井灾害防治理论与技术. 徐州:中国矿业大学出版社,19899 刘吉昌.煤矿施工设计基础.太原:山西人民出版社,198310 岑传鸿.采场顶板控制与检测技术. 徐州:中国矿业大学出版社,199811 蒋国安、吕家立.采矿工程英语. 徐州:中国矿业大学出版社,199812 李位民.特大型现代化矿井建设与工程实践. 北京:煤炭工业出版社,200113 综采设备管理手册编委会.综采设备管理手册. 北京:煤炭工业出版社,199414 能源部.煤矿安全规程. 北京:煤炭工业出版社,199215 中国煤矿专用设备成套服务公司.采煤机械化成套设备参考手册.煤炭工业部. 北京:煤炭工业出版社,198416 刘吉昌.煤矿施工设计基础. 太原:山西人民出版社,198317 中国统配煤矿总公司物资供应局.煤炭工业设备手册. 徐州:中国矿业大学出版社,199218 章玉华.技术经济学. 徐州:中国矿业大学出版社,199519 综采设备管理手册. 北京:煤炭工业出版社,1994附录程序代码:模块中代码Public M(0 To 2) As DoublePublic N(0 To 2) As DoublePublic M1(0 To 2) As DoublePublic N1(0 To 2) As DoublePublic M2(0 To 2) As DoublePublic N2(0 To 2) As DoublePublic R(0 To 2) As DoublePublic l(0 To 2) As DoublePublic R1(0 To 2) As DoublePublic L1(0 To 2) As DoublePublic R2(0 To 2) As DoublePublic L2(0 To 2) As DoublePublic R3(0 To 2) As DoublePublic L3(0 To 2) As DoublePublic A(0 To 2) As DoublePublic B(0 To 2) As DoublePublic C(0 To 2) As DoublePublic D(0 To 2) As DoublePublic A1(0 To 2) As DoublePublic B1(0 To 2) As DoublePublic C1(0 To 2) As DoublePublic D1(0 To 2) As DoublePublic A2(0 To 2) As DoublePublic B2(0 To 2) As DoublePublic C2(0 To 2) As DoublePublic D2(0 To 2) As DoublePublic II1(0 To 2) As DoublePublic II2(0 To 2) As DoublePublic II3(0 To 2) As DoublePublic II4(0 To 2) As DoublePublic II5(0 To 2) As DoublePublic II6(0 To 2) As DoublePublic JiAo1 As DoublePublic JiAo2 As DoublePublic JiAo3 As DoublePublic JiAo4 As DoublePublic JiAo5 As DoublePublic BJiao1 As DoublePublic BJiao2 As DoublePublic BJiao3 As DoublePublic BJiao4 As DoublePublic BJiao5 As DoublePublic HouDu As DoublePublic H1 As DoublePublic H2 As DoublePublic HHY1 As DoublePublic HHY2 As DoublePublic MeiMiDu As DoublePublic ACADApp As Object 定义 AutoCAD 对象Public AcadDoc As ObjectPublic AcadMds As ObjectPublic AcadUtil As ObjectPublic WenZi As Object 定义图层Public TianChong As ObjectPublic XiAnTiAo1 As ObjectPublic XiAnTiAo2 As ObjectPublic XiAnTiAo3 As ObjectPublic QiTA As ObjectPublic TuBiLi As DoublePublic TuMingCheng As StringPublic ExcelApp As Object 定义 EXCEL 空间Public ExcelWBook As ObjectPublic ExcelWSheet As ObjectPublic ExcelShape As Excel.ShapesPublic ExcelChart As Excel.ChartPublic Excel_Name As StringPublic Paint_Name As StringPublic Sub ExitCadExcel()Set ACADApp = NothingSet AcadDoc = NothingSet AcadMds = NothingSet AcadUtil = NothingSet AcadPaperSpace = NothingSet WenZi = NothingSet TianChong = NothingSet XiAnTiAo1 = NothingSet XiAnTiAo2 = NothingSet XiAnTiAo3 = NothingSet QiTA = NothingSet ExcelApp = NothingEnd SubPublic Sub QiDongCad() 连接 CADOn Error Resume NextSet ACADApp = GetObject(, “AutoCAD.AppliCAtion“)If Err ThenErr.ClearSet ACADApp = CreateObject(“AutoCAD.AppliCAtion“)End IfSet AcadDoc = ACADApp.ActiveDocumentSet AcadMds = AcadDoc.ModelSpaceSet AcadUtil = AcadDoc.UtilitySet AcadPaperSpace = AcadDoc.PaperSpaceACADApp.Visible = TrueSet WenZi = AcadDoc.Layers.Add(“文字“)Set TianChong = AcadDoc.Layers.Add(“填充“)Set XiAnTiAo1 = AcadDoc.Layers.Add(“实线“)Set XiAnTiAo2 = AcadDoc.Layers.Add(“虚线“)Set XiAnTiAo3 = AcadDoc.Layers.Add(“中心线 “)Set QiTA = AcadDoc.Layers.Add(“其他“)Dim SimFangTextStyle As ObjectDim TimesTextStyle As ObjectSet SimFangTextStyle = AcadDoc.TextStyles.Add(“SimFang“)SimFangTextStyle.fontFile = “C:WINDOWSFontsSimFang.ttf“Set TimesTextStyle = AcadDoc.TextStyles.Add(“Times“)TimesTextStyle.fontFile = “C:WINDOWSFontsTimes.ttf“object.Load LineTypeName, FileNameDim LineTN As StringDim FileName As StringFileName = App.Path & “acadiso.lin“LineTN = “continuous“ACADDoC.Linetypes.Load LineTN, FileNameLineTN = “ACAD_ISO02W100“AcadDoc.Linetypes.Load LineTN, FileNameLineTN = “ACAD_ISO04W100“AcadDoc.Linetypes.Load LineTN, FileNameEnd SubPublic Sub QiDongExcel() 连接 EXCELOn Error Resume Next 忽略错误Set ExcelApp = GetObject(, “Excel.Application“) 查找一个正在运行的 Excel 拷贝If Err Then 如果 Excel 没有运行则Err.ClearSet ExcelApp = CreateObject(“Excel.Application“) 运行它End IfEnd SubPublic Sub AddLineText(X1 As Double, Y1 As Double, _HHeight As Double, VHeight As Double, S As String, t As Boolean)Dim Point1(2) As DoubleDim Point2(2) As DoubleDim Point3(2) As DoubleDim Point4(2) As DoubleDim Point5(2) As DoublePoint1(0) = X1Point1(1) = Y1Point2(0) = X1 + HHeightPoint2(1) = Y1Point3(0) = Point2(0)Point3(1) = Y1 - VHeightPoint4(0) = Point1(0)Point4(1) = Point3(1)Point5(0) = (Point1(0) + Point2(0) / 2Point5(1) = (Point1(1) + Point3(1) / 2Dim LinObject As ObjectSet LinObject = AcadMds.AddLine(Point1, Point2)LinObject.Linetype = “continuous“LinObject.Layer = “实线“Set LinObject = AcadMds.AddLine(Point2, Point3)LinObject.Linetype = “continuous“LinObject.Layer = “实线“Set LinObject = AcadMds.AddLine(Point3, Point4)LinObject.Linetype = “continuous“LinObject.Layer = “实线“Set LinObject = AcadMds.AddLine(Point4, Point1)LinObject.Linetype = “continuous“LinObject.Layer = “实线“Dim ValText As DoubleIf t = True ThenValText = Val(S)ValText = ValText * 100ValText = Fix(ValText)ValText = ValText / 100S = Str(ValText)ElseEnd IfDim TextHeight As DoubleTextHeight = VHeight * 0.5Set TextObj = AcadMds.AddText(S, Point5, TextHeight)TextObj.StyleName = “Times“TextObj.HorizontalAlignment = acHorizontalAlignmentMiddleTextObj.TextAlignmentPoint = Point5End SubPublic Function WenBen2(Coner As Variant, widthw As Double, X As String, habcd As Double, SSX As Double, SSY As Double)Dim Corner1(0 To 2) As DoubleDim width As DoubleDim text As StringDim anObj As ObjectCorner1(0) = Coner(0) + SSX: Corner1(1) = Coner(1) + SSY: Corner1(2) = 0#width = widthwtext = XSet anObj = AcadDoc.ModelSpace.AddMText(Corner1, width, text)anObj.Height = habcdanObj.StyleName = “Times“End FunctionPublic Sub ScaleEntityAllAcad(BiLi As Double)Dim SSetObj As AcadSelectionSetDim SSetObjName As StringSSetObjName = Time()Set SSetObj = AcadDoc.SelectionSets.Add(SSetObjName)SSetObj.Select acSelectionSetAllDim BasePoint(2) As DoubleBasePoint(0) = 0: BasePoint(1) = 0: BasePoint(2) = 0Dim ScaleFactor As DoubleScaleFactor = BiLiDim Ent As ObjectFor Each Ent In SSetObjEnt.ScaleEntity BasePoint, ScaleFactorNextEnd SubPublic Sub MoveAllAcad(X1 As Double, Y1 As Double, _X2 As Double, Y2 As Double)Dim SSetObj As AcadSelectionSetDim SSetObjName As StringSSetObjName = Time()Set SSetObj = AcadDoc.SelectionSets.Add(SSetObjName)SSetObj.Select acSelectionSetAllDim Point1(2) As DoubleDim Point2(2) As DoubleDim Ent As ObjectPoint1(0) = X1Point1(1) = Y1Point1(2) = 0Point2(0) = X2Point2(1) = Y2Point2(2) = 0For Each Ent In SSetObjEnt.Move Point1, Point2NextEnd SubPublic Sub AddMText2(Corner As Variant, Width1 As Double, _Text1 As String, Width2 As Double, Text2 As String, Height As Double)Dim Corner1(2) As DoubleDim Corner2(2) As DoubleCorner1(0) = Corner(0)Corner1(1) = Corner(1)Corner1(2) = Corner(2)Text1 = Trim(Text1)Text2 = Trim(Text2)Dim anObj As AcadMTextSet anObj = AcadDoc.ModelSpace.AddMText(Corner1, Width1, Text1)anObj.Height = HeightanObj.StyleName = “Times“If Text1 = “m“ Or Text1 = “w“ Or Text1 = “M“ Or Text1 = “W“ ThenCorner2(0) = Corner1(0) + Len(Text1) * HeightCorner2(1) = Corner1(1) - Height * 0.75Corner2(2) = Corner1(2)ElseCorner2(0) = Corner1(0) + Len(Text1) * Height * 0.5Corner2(1) = Corner1(1) - Height * 0.75Corner2(2) = Corner1(2)End IfSet anObj = AcadDoc.ModelSpace.AddMText(Corner2, Width2, Text2)anObj.Height = Height / 2anObj.StyleName = “Times“End Sub
展开阅读全文