7 Replies Latest reply on Feb 15, 2010 2:30 PM by matthew.kesinger

    Automation and VB.net


      Hi All,


      Does anyone have any experience using VB.net for Expedition automation.

      There are a lot of restrictions in what I can use for user interface elements in VBScript.

      For example, I need to use a tabbed interface in my automation, too many interface elements for a single form.


      Can anyone advise me on just how to get started, connect to the running Expedition application, etc.

      Would also like to have a compiled .exe from the vb.net soding and add this to the menu in Expedition.


      Some kickoff examples would be very useful, even a startup project that I could then write my application in.


      Any help greatly appreciated.

        • 1. Re: Automation and VB.net

          Hi bparise-san,


          I send a startup template for Visual Basic 2005 (.NET).

          I think that I can use it in Visual Basic 2008 if you convert the template.



          • 2. Re: Automation and VB.net


            Thanks very much, I will take a look and see if it helps.

            • 3. Re: Automation and VB.net


              If you are in a Dx/Expedition flow, the Dx side has an IVGrid Control that gives you tabular forms.  This can be used in the Expedition Form Editor.  I don't have any examples in AATK because if you don't have Dx Loaded it croaks.  You can copy the files from another tree and register them but it's not something I want everybody to have to perform.



              • 4. Re: Automation and VB.net


                Thanks for the info, I didn't know about that. When I try to add a different active X control in VBscript I usually get a message saying it is unable to use the control so I am restricted to the controls that are built in to vbscrip. I would prefer to use the vbscript, it is simpler and easier to implement inside expedition. My only issue with it is that I need more advanced interface controls because I need to collect quite a bit of info from the user, so a tabbed dialog is pretty much a requirement. If you have knowledge of any other flexibility in this respect I would certainly appreciate knowing, a date/time picker for example would also be very useful. But I may implement something like Excel where < CTRL ; > enters current date.


                Anyway, thanks for your help, much appreciated. I will try it this weekend.

                • 5. Re: Automation and VB.net


                  Thanks very much for the template.

                  I opened in 2008 Express, and the tool did automatic conversion.

                  Then placed a tab control, on 3rd tab I added a button and text box.

                  Set the button click to display the name of the opened pcb in expedition in the text box.


                  Worked first time, great.

                  You do not have much choice of interface components in the scripting IDE, and I simply can't get frames to make all the controls in them go invisible when I make the frame invisible. I needed much more form real estate so the tab control in 2008 express is the one I needed to use.


                  When it converted, there is a bunch of comment text that is not readable: for example:


                  Public Sub MGCPCB_Disconnect()
                          ' disconnects from MGCPCB.
                          'UPGRADE_NOTE: ƒIƒuƒWƒFƒNƒg pcbDoc ‚ðƒKƒx&#129;[ƒW ƒRƒŒƒNƒg‚·‚é‚Ü‚Å‚±‚̃IƒuƒWƒFƒNƒg‚ð”jŠü‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ&#129;B &#143;Ú&#141;ׂɂ‚¢‚Ä‚Í&#129;A'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"' ‚ðƒNƒŠƒbƒN‚µ‚Ä‚‚¾‚³‚¢&#129;B


                  Can you let me know what all the comment text in the template is supposed to say, and I will update it and return to you as a 2008 template.


                  Couple more questions:

                  1: Where do we add the Expedition type libraries for enumerations?

                     e.g.  Scripting.AddTypeLibrary("MGCSDD.KeyBindings")  in VBScript in the Mentor Automation IDE.


                  2: Once I have my application done, do you know if it can be added to the expedition main menu, and how?


                  3: How would I gain access to the PCB Data Objects and PCB Data Collections.


                  Sorry if the questions seem basic, I am new to this and need to get up to speed quickly, so I appreciate any advice you can give.


                  I would like to provide the finished template as a starting project for Mentor users. I think Mentor should provide and document this process anyway, maybe they have, I just haven't found or read about it yet.


                  Thanks in advance


                  • 6. Re: Automation and VB.net

                    Hi bparise-san,


                    I remember having upgraded the template of VB6 by VB.Net.

                    It was processed by Japanese version VB.Net.

                    Japanese version VB.Net added the comment in Japanese.


                    'UPGRADE_WARNING: A established property of the object "LicenseServer.GetToken" was not able to be solved.


                    I think that you may delete this comment.




                    • 7. Re: Automation and VB.net

                      What reference did you have to add to the get Scripting.AddTypeLibrary functionality to be recognized?  I can't seem to find it, and all the Mentor documentation just assumes this is automatically available.