这是一个类 Cad_PointPublic x As Double Public y As Double Public z As Double Private location(0 To 2) Private AutoCadApp As AcadApplication Private Cad_PointObj As AcadPoint Public MODE As Integer Public SIZE As IntegerPrivate Sub Class_Initialize() x = 10# y = 10# z = 0# MODE = 32 SIZE = 5 End Sub Public Sub Draw(ByRef CadObj As AcadApplication) Set AutoCadApp = CadObj location(0) = x: location(1) = y: location(2) = z Set Cad_PointObj = AutoCadApp.ActiveDocument.ModelSpace.AddPoint(location) ZoomAll Set AutoCadApp = Nothing End Sub 这个Draw方法 我在调用的时候 传入一个 全局的AcadApplication 对象实例 当运行到 Set Cad_PointObj = AutoCadApp.ActiveDocument.ModelSpace.AddPoint(location) 的时候就报错 实时错误 5 无效的过程调用活参数
Public y As Double
Public z As Double
Private location(0 To 2)
Private AutoCadApp As AcadApplication
Private Cad_PointObj As AcadPoint
Public MODE As Integer
Public SIZE As IntegerPrivate Sub Class_Initialize()
x = 10#
y = 10#
z = 0#
MODE = 32
SIZE = 5
End Sub
Public Sub Draw(ByRef CadObj As AcadApplication)
Set AutoCadApp = CadObj
location(0) = x: location(1) = y: location(2) = z
Set Cad_PointObj = AutoCadApp.ActiveDocument.ModelSpace.AddPoint(location)
ZoomAll
Set AutoCadApp = Nothing
End Sub
这个Draw方法 我在调用的时候 传入一个 全局的AcadApplication 对象实例
当运行到
Set Cad_PointObj = AutoCadApp.ActiveDocument.ModelSpace.AddPoint(location)
的时候就报错 实时错误 5 无效的过程调用活参数