End Function
Public Sub Set_layer(s As String)
Dim layerObj As AcadLayer
Set layerObj = acadDoc.Layers.Add(s)
acadDoc.ActiveLayer = layerObj
End Sub
再按以下模式做个对话框:窗体的名字就叫“Form1”

双击“展点”按钮,输入以下代码:
Dim p0(2) As Double, p1(2) As Double, p2(2) As Double
Dim T1 As Double, T2 As Double, T3 As Double, T4 As Double
Public ne As Integer, sp As Single, cz As Single
Call Get_ACAD("")
Dim txt As AcadText
Dim la As AcadLayer
For Each Layer In acadDoc.ModelSpace
Next
Call Set_layer("zdh")
Set Sheet = ThisWorkbook.ActiveSheet
Dim i As Integer
Do While Sheet.Cells(i + 1, 3) <> "" Or Sheet.Cells(i + 1, 1) <> ""
If Sheet.Cells(i + 1, 3) = "" Or Sheet.Cells(i + 1, 4) = "" Then GoTo II
With Sheet
p1(0) = .Cells(i + 1, 3).Value
p1(1) = .Cells(i + 1, 4).Value
p1(2) = .Cells(i + 1, 5).Value
End With