Search code examples
modelicaopenmodelica

Images in OpenModelica Documentation


Following is an example of how an image is embedded in an OpenModelica Documentation.

modelica://Modelica/Resources/Images/Blocks/Sources/Constant.png\

Can I know what modelica: is in the code? If I am not mistaken its the OPENMODELICALIBRARY environment variable. Right?

Also, If I have to embed images in a model that I have created, how do I use the above format? (Currently I'm hardcoding the path to where the image exists in the model. This would be of no use say I give this library to someone else unless they keep the image in the same path)

Thanks in Advance, MSK


Solution

  • Is not OPENMODELICALIBRARY as that contains several Modelica libraries. Is the directory of the Modelica library that is loaded, that is OPENMODELICALIBRARY/Modelica 3.2.1/ or another one.

    Read the Modelica Specification (https://www.modelica.org/documents/ModelicaSpec32Revision2.pdf, 13.2.3 External Resources) with regards to modelica:// URIs. Basically modelica://LibraryName/... will lead to the actual path where library LibraryName is and what is after it will be looked up starting from that directory.