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

Re: Using VB script to export IDF and DXF formats from Expedition PCB

$
0
0

Hey Patrick,

 

you made it !!! I have my Macros up and running.

How do you know ? What kind of Support do I need to get this information from Mentor ?

Is there some Documentation I can find this in ?

 

Regarding your Script To Launch the ".exe", I created a Macro in my tool, which sets up this script, if it is not there.

Makes it easier for me when distributing the tool. I attache it below for others.

 

  Sub createLauncherScript()        Dim thisAppPath As String        thisAppPath = Application.StartupPath        Dim thisAppName As String        thisAppName = Application.ProductName        thisAppName = IO.Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location) ' the *.exe Name        Dim ffn As String ' --> ffn = Full File Name        ffn = IO.Path.Combine(thisAppPath, thisAppName)        Dim sb As StringBuilder        sb = New StringBuilder        With sb            .AppendLine("Option Explicit")            .AppendLine()            .AppendLine("#")            .AppendLine("# Script Automatically Created by: " & thisAppName)            .AppendLine("#")            .AppendLine()            .AppendLine("Call run")            .AppendLine()            .AppendLine("Sub run()")            .AppendLine()            .AppendLine("Dim objShell")            .AppendLine("Set objShell = CreateObject('WScript.Shell')")            .AppendLine()            .AppendLine("Dim regKey")            .AppendLine("regKey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\mglaunch.exe\'")            .AppendLine()            .AppendLine("Dim mglaunch")            .AppendLine("mglaunch = objShell.RegRead(regkey)")            .AppendLine()            .AppendLine("mglaunch = mglaunch & ' ' & Chr(34) & '" & ffn & "' & Chr(34)")            .AppendLine("objShell.run(mglaunch)")            .AppendLine()            .AppendLine("set objShell = Nothing")            .AppendLine()            .AppendLine("End Sub")        End With        Dim vbsCode As String        vbsCode = sb.ToString.Replace("'", Chr(34))        vbsCode = vbsCode.Replace("#", "'#")        ffn = IO.Path.Combine(thisAppPath, IO.Path.GetFileNameWithoutExtension(thisAppName) & ".vbs")        My.Computer.FileSystem.WriteAllText(ffn, vbsCode, False, System.Text.Encoding.ASCII)        MsgBox("Ready")    End Sub

 

Thanks

 

Stefan

 

Ps.: I am using Visual Studio, as an IDE, works also very well.


Viewing all articles
Browse latest Browse all 4541

Trending Articles



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