下载vlax.cls或也可用USERS1-5来传递Handle Sub test() Dim lineObj1 As AcadLine Dim lineObj2 As AcadLine Dim lineObj3 As AcadLine Dim lineObj4 As AcadLine Dim pt1(0 To 2) As Double Dim pt2(0 To 2) As Double Dim pt3(0 To 2) As Double Dim pt4(0 To 2) As Double pt1(0) = 0#: pt1(1) = 0#: pt1(2) = 0# pt2(0) = 2#: pt2(1) = 3#: pt2(2) = -5# pt3(0) = 1#: pt3(1) = 5#: pt3(2) = 8# pt4(0) = 4#: pt4(1) = 0#: pt4(2) = 2# Set lineObj1 = ThisDrawing.ModelSpace.AddLine(pt1, pt2) Set lineObj2 = ThisDrawing.ModelSpace.AddLine(pt2, pt3) Set lineObj3 = ThisDrawing.ModelSpace.AddLine(pt3, pt4) Set lineObj4 = ThisDrawing.ModelSpace.AddLine(pt4, pt1) Dim VL As New VLAX VL.SetLispSymbol "hd1", lineObj1.Handle VL.SetLispSymbol "hd2", lineObj2.Handle VL.SetLispSymbol "hd3", lineObj3.Handle VL.SetLispSymbol "hd4", lineObj4.Handle ThisDrawing.SendCommand "(command ""edgesurf"" (Handent hd1) (Handent hd2) (Handent hd3) (Handent hd4)) " End Sub |