Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Editing Icons

Editing Icons

Hello,

How can I edit/create icons in simforge? 

Thanks

Re: Editing Icons

Hi

Icons are drawn from the information provided in the annotations inside each component. If you look for example in the standard Modelica  library component for the electrical  ground then you will find this information:

// This is the result from the OMC API call which is basically printing the annotation textstring belonging to the Ground component //
>> loadModel(Modelica.Electrical.Analog.Basic.Ground)
>> getIconAnnotation(Modelica.Electrical.Analog.Basic.Ground)
{-100.0,-100.0,100.0,100.0,{Line(true,{{-60.0,50.0},{60.0,50.0}},{0,0,255},LinePattern.Solid,0.25,{Arrow.None,Arrow.None},3.0,false),Line(true,{{-40.0,30.0},{40.0,30.0}},{0,0,255},LinePattern.Solid,0.25,{Arrow.None,Arrow.None},3.0,false),Line(true,{{-20.0,10.0},{20.0,10.0}},{0,0,255},LinePattern.Solid,0.25,{Arrow.None,Arrow.None},3.0,false),Line(true,{{0.0,90.0},{0.0,50.0}},{0,0,255},LinePattern.Solid,0.25,{Arrow.None,Arrow.None},3.0,false),Text(true,{0,0,0},{0,0,255},LinePattern.Solid,FillPattern.None,0.25,{{-144.0,-60.0},{138.0,0.0}},"%name",0.0,"")}}

Either read the Modelica specification or  the book Peter Fritzson. Principles of Object-Oriented Modeling and Simulation with Modelica 2.1. 940 pages, Wiley-IEEE Press,
2004
for more inforamtion about annotations.

Best Regards
Mohsen

There are 0 guests and 0 other users also viewing this topic