Got some problems by accessing events thru macro, and like to know which events can/can't be accessed by macro programming !! --- made a post on UGS forum with the aim, too....
To me it seems like code from vb6 doesn't work for events on Framework 2.0 and Studio2005, cause of EventHandler missing ;; tried to get it working, and found some lines in "Customizing SolidEdge" doing well, but can't get a clue why!!
Whats a bit strange to me, is the declearation with ISEApplicationEvents_Event cause it's not in the Studio-build interop. dlls but the code recognizes it & program's working = ?
cant find a working declaration for FileUIEvents, too...
Whats the mystery about it ?
** AppEvents Here **
Public Class Form1
Public WithEvents AE As SolidEdgeFramework.ISEApplicationEvents_Event
Public SE_app As SolidEdgeFramework.Application
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Get SE object
SE_app = GetObject(, "SolidEdge.Application")
AE = SE_app.ApplicationEvents
Public Sub AE_AfterDocumentSave(ByVal doc As Object) _
Public Sub AE_AfterCommandRun(ByVal CommandID As Integer) _
MsgBox("AfterCommandRun= " & CommandID)
Public Sub AE_BeforeCommandRun(ByVal CommandID As Integer) _
MsgBox("BeforeCommandRun= " & CommandID)
A working Code from vb6 from "Julian Guillo"
>Dim objSE As SolidEdgeFramework.Application
>Dim WithEvents objAppEvents As SolidEdgeFramework.ApplicationEvents
>Private Sub Form_Load()
> Set objSE = GetObject(, "solidedge.application")
> Set objAppEvents = objSE.ApplicationEvents
>Private Sub objAppEvents_AfterCommandRun(ByVal theCommandID As Long)
> MsgBox "Command ID=" & theCommandID & " was activated"
>Private Sub objAppEvents_AfterDocumentOpen(ByVal theDocument As Object)
> MsgBox "Welcome to document " & theDocument.FullName
>Private Sub objAppEvents_BeforeDocumentSave(ByVal theDocument As Object)
> 'Calculate weight
> 'Write weight into a custom property.
Posted by: Linus Hechinger Post date: 11/19/2008 9:29:06 PM