guoxianlun 发表于 2008-2-25 17:35:00

[求助]这段代码为何运行不了?

<p>Private Sub CommandButton1_Click()<br/>Dim textpoint(0 To 2) As Double '声明文字插入点<br/>Dim texthight As Double<br/>Dim textstr As String<br/>Dim textObject As AcadText<br/>textpoint(0) = 20<br/>textpoint(1) = 40<br/>textpoint(2) = 0<br/>texthigh = 10<br/>textstr = "autocad activex/vba" '设置字符串<br/><font color="#ff0066">Set textObject = ThisDrawing.ModelSpace.AddText_(textstr, textpoint, TextHeight)<br/></font>ThisDrawing.Application.ZoomExtents<br/>textObject.Update<br/>End Sub</p><p>以上代码是一本书上的示例,但我试着运行后出现红字的语句错,提示错误代码"438",对象不支持该属性或方法。在CAD2004和2007版运行均是同样的情况。</p><p>请问是什么原因?</p>

guoxianlun 发表于 2008-2-25 17:50:00

Private Sub CommandButton1_Click()<br/>Dim textpoint(0 To 2) As Double '&Eacute;ù&Atilde;÷&Icirc;&Auml;×&Ouml;&sup2;&aring;&Egrave;&euml;&micro;&atilde;<br/>Dim texthEight As Double<br/>Dim textstr As String<br/>Dim textObject As AcadText<br/>textpoint(0) = 20<br/>textpoint(1) = 40<br/>textpoint(2) = 0<br/>texthEight = 10<br/>textstr = "autocad activex/vba" '&Eacute;è&Ouml;&Atilde;×&Ouml;·&ucirc;&acute;&reg;<br/>'chuanjjjjj<br/>Set textObject = ThisDrawing.ModelSpace.AddText(textstr, textpoint, texthEight)<br/>ThisDrawing.Application.ZoomExtents<br/>textObject.Update<br/>End Sub
页: [1]
查看完整版本: [求助]这段代码为何运行不了?