• 617 views | 12 messages Discussion: LEAP
    Topic: Menu advanced disappeared in the last releaseSubscribe | Previous | Next
  • Marcelo Resende 12/18/2017

    1 Like

    I have just updated LEAP in my computer and tried to run a script that I had previously written, but I could not find the "advanced" menu. Has the way to access these scripts changed?

    By the way, is there some way to download a previous version of LEAP? Because it seems the scripts I have stopped working with the last release (I used to declare a global vector in the script, and I could run the script multiple times without any problem. However, if I run the same script now, it breaks in the second time it is runned, showing an error that this global vector already exists).

    Thank you,
    Marcelo Resende


  • Taylor Binnington 12/19/2017
      Best Response

    7 Likes

    Hi Marcelo -

    No, the way that scripts are accessed and modified from within LEAP has not changed. I'm not sure why you cannot see the Advanced menu - are you in the Analysis view, and the option is simply not there? Can you attach a screenshot?

    Can you describe how you run your scripts if you cannot access the Advanced menu? In order to help with the global variable issue, you'll also need to include a minimal working example of your script, with specific instructions for how you are running it.

    Thanks,
    Taylor

  • Marcelo Resende 12/19/2017
      Best Response

    Exactly, the "advanced" menu simply vanished from the analysis view, as shown in the image attached.

    The other error I am reporting, about the script that is breaking, appeared with the release 2018.1.0. By that time, the menu "advanced" was still available and so I could run the script. I am sending here the initial part of the code. The error occurs when I run this script for the second consecutive time. A message box indicates that the bold vectors are already loaded. This was not happening in the version of 2017.

    '-------------------------------'
    ' Establecer variables globales '
    '-------------------------------'

    ' Workbook correspondiente al archivo data.xlsx '
    DIM objWorkbook

    ' Sheet "consumo_energetico" del archivo data.xlsx '
    DIM sheet_consumo_energetico_agregado

    ' Sheet de interes del archivo Scen_demandas.xlsx '
    DIM sheet_resultado

    DIM NotFoundInScenDemands
    NotFoundInScenDemands = 0

    ' Directorio de la area PERUTIMES '
    DIM CurrentDirectory

    ' Vectores con las regiones y correspondientes abreviaciones '
    Dim Regions(3)
    Regions(0) = "Center"
    Regions(1) = "North"
    Regions(2) = "Eastern"
    Regions(3) = "South"

    Dim RegionsAbbreviation(3)
    RegionsAbbreviation(0) = "CEN"
    RegionsAbbreviation(1) = "NOR"
    RegionsAbbreviation(2) = "ORI"
    RegionsAbbreviation(3) = "SUR"


    Capture.PNG
  • Taylor Binnington 12/21/2017
      Best Response

    Hi Marcelo -

    Sorry I didn't think of this immediately. The new 64-bit version of LEAP does not have full API functionality yet, though this is something we hope to introduce in the future. To access the API, you will need to use the 32-bit version of LEAP, which can be downloaded here.

    Note that it is possible to have both versions installed on your computer simultaneously.

    Taylor

  • Charlie Heaps 12/22/2017
      Best Response

    Hi all,

    Actually you can use the API in the 64-bit version of LEAP, but it takes a bit of fiddling around because Microsoft no longer directly supports Windows Scripting Host in 64-bit Windows. However it can still be made to work through use of a 3rd party component (which is installed along with LEAP). However, that component some times does not auto-register itself. When this happens, LEAP falls back to not showing the Advanced menu.

    I am just getting on a plane now, but when I get somewhere where I can use LEAP, I will follow up with extra instructions on how to register the component. I will also try to make this all work more reliably in a future release.

    Best,

    Charlie

  • Marcelo Resende 12/29/2017
      Best Response

    Thank you!
    I have downloaded the 32-bit version. The advanced option is there.

    Charles, there is no problem for me in using this version, so I do not need these instructions, but thank you for the help! I think it may be useful for other members if you post these instructions anyway.
    As for the error with the vector "Regions", it is still happening. Actually, now the error message is different, it says: "an error ocurred in LEAP. ELEAPError - Error in script "Run Demand Model.vbs" at line 27, column 1 - Type Mismatch"

    Line 27 is the one in which I declare the vector "Dim Regions(3)". Has something changed that made vector declaration not possible?

    Thank you

  • Gregers Larsen 1/2/2018
      Best Response

    I have encountered the same problem of having no Advanced menu and have a follow-up question,

    If I start testing scripts in the latest 32-bit version of LEAP, these should reliably be functioning in the 64-bit version when the Advanced menu and the Script Edit is reintroduced, right?

  • Marcelo Resende 2/2/2018
      Best Response

    I am still having this problem with the declaration of vector "Regions". Can anyone help?
  • Charlie Heaps 2/5/2018
      Best Response

    1 Like

    >>I have encountered the same problem of having no Advanced menu and have a follow-up question, If I start testing scripts in the latest 32-bit version of LEAP, these should reliably be functioning in the 64-bit version when the Advanced menu and the Script Edit is reintroduced, right?

    Short answer:

    yes - scripts developed for 32-bit LEAP will also work in 64-bit.

    Long Answer:

    The reason you cant see the Advanced menu is that a special extra DLL file needs to be downloaded and registered to support scripting under 64-bit apps within 64-bit Windows. Microsoft no longer support MSSCRIPT.OCX with 64-bit Windows apps. However, a 3rd party DLL - the Tablacus Script Control - seems to do a good job of supporting scripts in 64-bit Windows.

    You can download the DLL here:
    ftp://ftp.energycommunity.org/leap/tsc64.zip

    Unzip this file so that the DLL file is on your LEAP program folder (normally C:\Program Files\LEAP) then register the file using this command from the Windows Command Prompt (Type CMD into the Windows Search box):

    Regsvr32 tsc64.dll

    if that doesn't work, try:
    \windows\system32\Regsvr32 tsc64.dll

    You will need to have admin rights to properly register the DLL.

    The next version of LEAP will include this DLL and will automatically register it, so the above steps will not be needed.

    Once you follow the above instructions, the Advanced menu should again be visible in the 64-bit version of LEAP and you should be able to edit and run the same scripts you use in your 32-bit apps.

    Hope this helps,

    Charlie

  • Gregers Larsen 8/28/2018
      Best Response

    I have the newest version of LEAP 64bit and I can still not get the "Advanced" menu to appear. The DLL file is in place in the LEAP directory, but seemingly not registered. Any method described in the cmd gives the attached error. I have Admin rights.

    I have even tried deleting and reinstalling LEAP, but no good. What could be going wrong?


    LEAP dll error.PNG
  • Charlie Heaps 8/29/2018
      Best Response

    Hi Gregers,

    The command you are issuing is correct "regsvr32 tsc64.dll". But I think regsvr32 is failing to find the file tsc64.dll. I think that is because you are issuing the command while in the wrong folder. Make sure you first change directory to the program files\leap folder (the folder where tsc64.dll is located).

    Hope this helps!

    Charlie

  • Gregers Larsen 8/30/2018
      Best Response

    2 Likes

    I solved it! For anyone not familiar with Commando Prompt that has similar issues, here is what I did step-by-step:

    Prerequisites:
    * Have admin access on your PC
    * Close LEAP before beginning
    * Make sure LEAP is updated (then you'll already have the DLL file)
    * Find your LEAP install folder on your PC (usually \program files\leap\)

    Steps:
    1) Search "CMD" in your start menu. Commando Prompt should appear
    2) Right-click on the Commando Prompt results and choose "Run as Administrator"
    3) Commando Prompt will appear
    4) Write the following in CMD (no quotation marks): "cd \program files\leap" - If LEAP is installed in another folder, use that after cd - click enter after writing
    5) The directory should now show "C:\Program Files\LEAP\>" In that line write (no quotation marks): "regsvr32 tsc64.DLL". Press enter
    6) You should get a success pop-up

    When you now open LEAP 64-bit, the Advanced menu should be visible!

    Attached is a picture of my CMD line-by-line

    Gregers Larsen


    LEAP dll error.PNG