modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
452 stars 165 forks source link

Wrong results for Modelica.Utilities.Files.loadResource() #4293

Closed RobertReiser closed 5 months ago

RobertReiser commented 5 months ago

The function Modelica.Utilities.Files.loadResource() returns incorrect results.

Example: Modelica.Utilities.Files.loadResource("modelica://MyLibrary/"); = "D:/Work/modelica:/MyLibrary/"

The correct result is: = "D:/Libraries/MyLibrary/"

Tested with Dymola 2023x and Dymola 2024x on Windows and Linux.

HansOlsson commented 5 months ago

In order to test the main branch with a released Dymola you need:

  1. An updated ModelicaServices 4.1.0 for Dymola (*) ModelicaServices 4.1.0.zip Either placed next Modelica and ModelicaServices, or just somewhere on the ModelicaPath (including in %Dymola%/Modelica/Libraries).
  2. Set the flag: Advanced.Translation.PlaceDymolaSourceFirst=2;

*: Alternatively you can just manually load the ModelicaServices from the Dymola distribution after unloading the other one, but that can be a bit messy.

RobertReiser commented 5 months ago

It works with the updated ModelicaServices library, thanks!