内因事件
以前有人使用过这个功能吗?我认为这可能是一个强大的东西。我在开发文档中找到了它。Public with events ACADApp作为AcadApplication与应用程序事件示例一起使用
Sub Example_AcadApplication_Events()
' This example intializes the public variable (ACADApp) which will be used
' to intercept AcadApplication Events
'
' The VBA WithEvents statement makes it possible to intercept an generic object
' with the events associated with that object.
'
' Before you will be able to trigger any of the AcadApplication events,
' you will first need to run this procedure.
' We could get the application from the ThisDocument object, but that would
' require having a drawing open, so we grab it from the system.
Set ACADApp = GetObject(, "AutoCAD.Application.16")
End Sub
Private Sub ACADApp_EndOpen(ByVal FileName As String)
' This example intercepts an Application EndOpen event.
'
' This event is triggered when AutoCAD finishes opening a drawing.
'
' To trigger this example event:
' 1) Make sure to run the example that initializes
' the public variable (named ACADApp) linked to this event.
'
' 2) Use AutoCAD to open an existing drawing and wait until the
' operation finishes
' Use the "FileName" variable to determine which drawing file is being opened
MsgBox "A drawing was just loaded from: " & FileName
End Sub
这太棒了!问题是,就像它在上面的过程中所说的那样,你必须先运行它,然后内窥镜才能工作。我不想手动运行此操作。有人有什么想法吗?谢谢大R 对不起,伙计们,代码对我不起作用。我将再次尝试粘贴它。
大R 在这里,看看第一个线程中的代码。
再次表示感谢。
大R
页:
[1]