Quantcast
Channel: Mentor Graphics Communities: Message List
Viewing all articles
Browse latest Browse all 4541

Re: Automation in dxdesigner

$
0
0

Hello,

you can use the BeforeProjectChanged() event, unlike the name suggest it also triggers when closing a project.

It does not trigger when closing Dxdesigner so for for that you also need to use the shutdown() event.

 

Example in vbscript:

 

 

 

Scripting.AddTypeLibrary("ViewDraw.Application")

Dim VdApp : Set VdApp = Application

Call Scripting.AttachEvents(VdApp, "VdApp")
Scripting.DontExit = True


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub VdApp_Shutdown()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Len(vdapp.GetProjectData().GetProjectPath) <> 0 then 'also triggers on opening a design
  msgbox "Shutdown" & vbnewline & "Active Design:" & vdapp.GetProjectData().GetProjectPath & "(" & vdapp.GetActiveDesign() & ")"
end if
End sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

 

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub VdApp_BeforeProjectChanged()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if Len(vdapp.GetProjectData().GetProjectPath) <> 0 then 'also triggers on opening a design
  msgbox "Before project is closed" & vbnewline & "Active Design:" & vdapp.GetProjectData().GetProjectPath & "(" & vdapp.GetActiveDesign() & ")"
end if
End sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

 


Viewing all articles
Browse latest Browse all 4541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>