Reply

Which events can/can't be accessed by macro programming - examples !!

[ Edited ]

 

Hi guys !

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

    End Sub

    Public Sub AE_AfterDocumentSave(ByVal doc As Object) _

    Handles AE.AfterDocumentSave

        MsgBox("AE.AfterDocumentSave")

    End Sub

    Public Sub AE_AfterCommandRun(ByVal CommandID As Integer) _

    Handles AE.AfterCommandRun

        MsgBox("AfterCommandRun= " & CommandID)

    End Sub

    Public Sub AE_BeforeCommandRun(ByVal CommandID As Integer) _

    Handles AE.BeforeCommandRun

        MsgBox("BeforeCommandRun= " & CommandID)

    End Sub

End Class

******

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

>End Sub

>

>Private Sub objAppEvents_AfterCommandRun(ByVal theCommandID As Long)

>    MsgBox "Command ID=" & theCommandID & " was activated"

>End Sub

>

>Private Sub objAppEvents_AfterDocumentOpen(ByVal theDocument As Object)

>    MsgBox "Welcome to document " & theDocument.FullName

>End Sub

>

>Private Sub objAppEvents_BeforeDocumentSave(ByVal theDocument As Object)

>    'Calculate weight

>    'Write weight into a custom property.

>End Sub

THX Linuz

 

Posted by: Linus Hechinger
Post date: 11/19/2008 9:29:06 PM