7 Replies Latest reply on Aug 28, 2018 11:30 AM by andrew_french

    hyperlynx automation


      I'm trying to assign models to a pin and I don't understand the documentation on what its looking for.


      The pin object contains the method  AssignModel


      AssignModel File, Device, ModelPin – Assigns model specified by file, device (model component) and

      model pin. Returns TRUE if the model is successfully assigned, FALSE otherwise. (See also Object

      representing single Stackup layer (see also Stackup).


      What values is it looking for for File, Device, and ModelPin?  Yes I know strings.  I tried pin.AssignModel("demo1.ibs", "COMP1", "in1") and some others but I always get False returned.  I don't know if I have one or many values wrong unfortunately.

        • 1. Re: hyperlynx automation

          More awesomeness from AATK/HyperLynx/Working


          Dim HLAPP 'As HLApplication
              'Set HLAPP = CreateObject("HyperLynx.HLApplication") 'Open a new HyperLynx in the background
              Set HLAPP = GetObject("", "HyperLynx.HLApplication")
              'Scripting.AddTypeLibrary ("HyperLynx.HLApplication") 'Add the type lib so we can use enumerated types
              Dim Schem 'As HLSchematic
              Dim Sim 'As HLSimulator
              Dim SimR 'As HLSimResult
              'Set Schem = HLAPP.Schematic
              Set Schem = HLAPP.NewSchematic() 'Lets create a new linesim
              Set Sim = HLAPP.Simulator
              Set SimR = Sim.Result

              Dim IC1 'As HLScmIc
              Dim TL1 'As HLScmTline
              Dim IC2, TL2, i, res
              MsgBox "Lets add an IC"
              Set IC1 = Schem.AddObject(1) '(hlScmObjTypeIc) 'Add a driver/reciever symbol
              MsgBox "Lets add a Transmission Line"
              Set TL1 = Schem.AddObject(7) '(hlScmObjTypeTline) 'add a transmission line
              MsgBox "Lets connect them"
              Call Schem.Connect(IC1, 1, TL1, 1) 'connect the driver to the transmission line
              MsgBox "Take advantage of the awesome AutoPlace Function"
              Schem.AutoPlace 'use the autoplace to make them pretty
              MsgBox "Lets add another IC"
              Set IC2 = Schem.AddObject(1) '(hlScmObjTypeIc)
              MsgBox "connect them"
              Call Schem.Connect(IC2, 1, TL1, 2)
              MsgBox "More Awesomeness"
              MsgBox "Add a driver model"
              Call IC1.AssignModel("demo1.ibs", "COMP1", "14") 'Assign the driver model
              MsgBox "Add a Reciever model"
              Call IC2.AssignModel("demo1.ibs", "COMP1", "1") 'Assign the reciever model
              MsgBox "Lets run the simualation"
              If Sim.Run Then 'run the simulation

                  'For i = 1 To SimR.Waveforms.Count
                      MsgBox "Show some results"
                      SimR.Show 'Show the waveform

              End If

              MsgBox "FINI"



          1 of 1 people found this helpful
          • 2. Re: hyperlynx automation

            I don't know why I had the signal name stuck in my head as what I should enter for modelPin.  Seems really obvious now...Thanks for the help I got it to work this morning.

            • 3. Re: hyperlynx automation

              I'm assigning models to pins in board sim and I want to save my changes. 


              bswlib.HLDesign design = HLApp.Design;


              design.Save();  Does not save any of the models I've assigned.  Does anyone else have this issue? 


              The main issue I'm guessing is I can't grab the existing instance of Hyperlynx, my script launches hyperlynx and loads the selected cce or hyp file.  I'm not sure why my normal way of grabbing a running instance of designer or layout isn't working here.  maybe a version issue?  We're on VX.2.2 for Xpedition and using hyperlynx 2.3.  Even then Im loading the appropriate dll for hyp 2.3, so that doesn't seem like it should be it.


              If I manually start the cce or hyp file and assign models manually they will save.

              • 4. Re: hyperlynx automation

                How are you grabbing existing instance of Hyperlynx?  Can you include the line/code?

                • 5. Re: hyperlynx automation

                  bswLib.HLApplication app = (bswLib.HLApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("Hyperlynx.HLApplication");


                  Not sure why this isn't working for me.  Same structure works for MGCPCB.Application.  Maybe the documented string for the active object is wrong?

                  • 6. Re: hyperlynx automation

                    Yes, Hyperlynx.HLApplication works differently than MGCPCB.Application.  So, your implementation is probably invoking another (new) Hyperlynx process (i.e. look for bsw.exe in Task Manager to confirm) instead of grabbing existing instance.  One idea is to grab existing instance of Hyperlynx using process-id.

                    • 7. Re: hyperlynx automation

                      Okay so this is what I'm thinking is going on with the save issue because I talked to the engineer who I developed the script for and he is able to save the model assignments just fine.  The way I'm currently starting Hyperlynx in automation and then loading the design does not give me the option to define my license check outs so I'm likely stuck with what ever I choose before when I last started the tool manually.  Is there a way to force the license prompt on start up in automation?


                      The line of code I previously supplied does not start a new instance of Hyperlynx.  If license availability becomes an issue when using my script I might explore using the process ID to connect to an existing instance.


                      Would be nice if there was some continuity between all the applications and how their automation is implemented.