3 Replies Latest reply on Nov 8, 2011 9:19 PM by Wolfgang_Antrey

    Add a link to our companie's help system

    adam_juntunen

      Hi,

      I need to add a link to our internal help system to Expedition PCB for our users.  I see how to create a new toolbar and then add existing icons to it, but what I'd like to do is create a new icon that goes to our corporate help system and then add it for all users.

       

      I don't have an automation license, so hopefully this can be done without that.

       

      thanks

       

      adam

        • 1. Re: Add a link to our companie's help system
          Wolfgang_Antrey

          >>> Create Menue-Entrie - here in DXDesigner (should be no problem to do it for Expedition since sampe scripts are available from Mentors homepage

           

          Set sMenu = CommandBars("Sheet Menu Bar").Controls.Add(cmdControlPopup,,,7)

          sMenu.Caption = "prop Tools"

           

          set sButton = sMenu.Controls.Add

          sButton.Caption = "INTERNET"

          sButton.OnAction = "run StartInternet.vbs"

          <<<<< Menue Entrie end.

           

          >>file: StartInternet.vbs

          Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.orf.at"

          Sub Run(ByVal sFile, sArgument)

          Dim shell

          Set shell = CreateObject("WScript.Shell")

              shell.Run Chr(34) & sFile & Chr(34) & " " & sArgument, 1, False

              Set shell = Nothing

          End Sub

           

          The "startinternet.vbs" file creates a scripting shell - within the scripting shell you can start any windows programm you want. In this case Internet Explorer will be started ...

           

          I hope this helps.

           

          Wolfgang

          • 2. Re: Add a link to our companie's help system
            adam_juntunen

            Hi,

            thanks for the help - I'm almost there.  Where do I put the startInternet.vbs file and what file do I edit to add the sMenu stuff so I get a pull down?

            I've been looking at the automation documentation and all I've found so far is there is a scripts.ini file that loads scripts on startup if you put them in c:\MentorGraphics\7.9EE\SDD_HOME\standard, but that would just add a pointer to startInternet.vbs and I'm nost sure where the menu stuff would go.

             

            thanks

             

            adam

             

             

            • 3. Re: Add a link to our companie's help system
              Wolfgang_Antrey

              Generate a scripts.ini file an put it into eg the WDIR folder:

               

              [Expedition PCB - Document]

              Script#0=PATH_OF_VBS_SCRIPTS\EXP_menu.vbs

               

              You need a EXP_menu.vbs file - this will create an Expedition pull-down menue:

              It generates a pull down menue with the name "Tool Menue" - the menue will be visible as soon as a PCB is opened.

               

              ' Add any type libraries to be used.

              Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")

              Scripting.AddTypeLibrary("MGCSDD.CommandBarsEx")

              ' Get the application object.

              Dim pcbApp

              Set pcbApp = Application

              ' Find the document menu bar.

              Dim docMenuBarObj

              Set docMenuBarObj = pcbApp.Gui.CommandBars("Document Menu Bar")

              ' Get the collection of controls for the menu

              Dim docMenuBarCtrlColl

              Set docMenuBarCtrlColl = docMenuBarObj.Controls

              Dim max_menus

              max_menus = docMenuBarObj.Controls.Count()

              if docMenuBarCtrlColl.Item( max_menus - 1 ).Caption <> "Tool Menue" then

                ' Create the new button by adding to the control collection

                Dim countMenuObj

                Set countMenuObj = docMenuBarCtrlColl.Add(cmdControlPopup,,,max_menus)

                ' Configure the menu control

                countMenuObj.Caption = "Tool Menue"

                'Get the control collection for the new Count menu

                Dim countControlsColl

                Set countControlsColl = countMenuObj.Controls

                ' Create the new button by adding to the control collection

                Dim MenuObj

                Set MenuObj = countControlsColl.Add(cmdControlButton,,,-1)

                MenuObj.Caption = "OWN MENUEPOINT"

                MenuObj.OnAction = "run PATH_OF_VBS_SCRIPTS\external_script.vbs"

              end if

               

              An then you have to use the "wrapper" from my last post to call external programs.

               

              Wolfgang