- 积分
- 6961
- 明经币
- 个
- 注册时间
- 2004-4-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-8-7 17:49:00
|
显示全部楼层
我给你改写了一以下,看行不?
Sub Test() Dim ExcelApp As Object Dim TextObj As AcadText Dim sText As AcadTextStyle Dim pt5(1) As Double Dim pt(2) As Double Dim zkbh As String, bzdw As String, gcxm As String Set sText = ThisDrawing.TextStyles.Add("hz") sText.SetFont "ËÎÌå", False, False, 1, 1 sText.Width = 1.2 Set ExcelApp = CreateObject("Excel.Application") ExcelApp.Workbooks.Open "e:\lhs\cad\book1.xls" Sheets("Sheet1").Select zkbh = Range("B2").text bzdw = Range("B3").text gcxm = Range("B4").text pt5(0) = 34: pt5(1) = 24 pt(0) = pt5(0) + 2.8: pt(1) = pt5(1) + 2.5: pt(2) = 0 Set TextObj = ThisDrawing.ModelSpace.AddText(zkbh, pt, 10) pt(0) = pt5(0) + 32.8: pt(1) = pt5(1) + 2.5: pt(2) = 0 Set TextObj = ThisDrawing.ModelSpace.AddText(bzdw, pt, 10) pt(0) = pt5(0) + 62.8: pt(1) = pt5(1) + 2.5: pt(2) = 0 Set TextObj = ThisDrawing.ModelSpace.AddText(gcxm, pt, 10) End Sub |
|