czj 发表于 2005-1-17 14:29:00

[求助] 如何交互输入 2004

vba       我把代码放到按钮里,执行时出现主窗口不存在


Dim returnPnt As Variant<BR>                       <BR>                       ' Return a point using a prompt<BR>                       returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")<BR>                       MsgBox "The WCS of the point is: " &amp; returnPnt(0) &amp; ", " &amp; returnPnt(1) &amp; ", " &amp; returnPnt(2) &amp; vbCrLf &amp; _<BR>                                                                                       "(Enter the next value without prompting.)", , "GetPoint Example"<BR>                       <BR>                       ' Return a point, no prompt<BR>                       returnPnt = ThisDrawing.Utility.GetPoint<BR>                       MsgBox "The WCS of the point is: " &amp; returnPnt(0) &amp; ", " &amp; returnPnt(1) &amp; ", " &amp; returnPnt(2), , "GetPoint Example"<BR>                       <BR>                       ' Return a point using a base point and a prompt<BR>                       Dim basePnt(0 To 2) As Double<BR>                       basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#<BR>                       returnPnt = ThisDrawing.Utility.GetPoint(basePnt, "Enter a point: ")<BR>                       MsgBox "The WCS of the point is: " &amp; returnPnt(0) &amp; ", " &amp; returnPnt(1) &amp; ", " &amp; returnPnt(2)<BR>                       <BR>                       ' Create a line from the base point and the last point entered<BR>                       Dim lineObj As AcadLine<BR>                       Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, returnPnt)<BR>                       ZoomAll<BR>
页: [1]
查看完整版本: [求助] 如何交互输入 2004