AutoCAD VBA欢迎窗口程序

AutoCAD VBA欢迎程序,代码如下。

Public Sub HelloVba()
Dim strname As String
strname = InputBox("请输入你的名字", "helloVBA", "My Friend")
MsgBox strname & "让我们在图形窗口中欢迎你!"
Dim text As AcadText
Dim insertPoint(0 To 2) As Double
insertPoint(0) = 10
insertPoint(1) = 10
insertPoint(2) = 10
Set text = ThisDrawing.ModelSpace.AddText("Hello,VBA!", insertPoint, 5)
ThisDrawing.Application.ZoomExtents
End Sub

代码完。

Beginning is hard.

你可能感兴趣的:(AutoCAD VBA欢迎窗口程序)