Sub TEST() Dim VL As New VLAX Dim pt As Variant pt = VL.EvalLispExpression("(VLAX-3D-POINT (CADR (GRREAD t))) ") MsgBox pt(0) & ", " & pt(1) & ", " & pt(2) End Sub
Private Sub Class_Initialize() If Left(ThisDrawing.Application.Version, 2) = "15" Then Set VL = ThisDrawing.Application.GetInterfaceObject("VL.Application.1") ElseIf Left(ThisDrawing.Application.Version, 2) = "16" Then Set VL = ThisDrawing.Application.GetInterfaceObject("VL.Application.16") End If Set VLF = VL.ActiveDocument.Functions End Sub
Sub TEST() Dim VL As New VLAX Dim pt As Variant pt = VL.EvalLispExpression("(VLAX-3D-POINT (CADR (GRREAD t))) ") MsgBox pt(0) & ", " & pt(1) & ", " & pt(2) End Sub
调用些程序总是出错,依然是Dim VL As New VLAX的问题,错误号:-2147220999