- Index
- » Programming
- » Modelica Language
- » New Icons?
New Icons?
New Icons?
I want to bild a new model which is extended from Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe.
The model works, but it should have a competely new icon. When I draw the icon in th IconView of OMEdit then everything looks OK.
But if I place the model in an othe rmodel then it will be drawn with the icon defined Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe in the background.
How can i prevent the drawing of the inherited icon annotation.
- Darxon69
- 7 Posts
Re: New Icons?
Try primitivesVisible:
Code:
model A
extends B annotation(
IconMap(extent={{-100,-100}, {100,100}},primitivesVisible=false),
DiagramMap(extent={{-50,-50}, {0,0}},primitivesVisible=true)
);
end A;
- sjoelund.se
- 1700 Posts
Re: New Icons?
Thanks for thew answer but it does not work
- Darxon69
- 7 Posts
Re: New Icons?
Then make a detailed bug report and maybe it will become part of the next release: https://trac.openmodelica.org/OpenModelica/newticket
- sjoelund.se
- 1700 Posts
Re: New Icons?
Hello
I find in trac that this bug is closed https://trac.openmodelica.org/OpenModelica/ticket/1131
But i have OpenModelica 1.9.4~dev-94-ge7263fe and code
Code:
model PartialTwoPort
extends Modelica.Fluid.Interfaces.PartialTwoPort annotation(Icon(primitivesVisible = false));
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end PartialTwoPort;
and it didn't work.
My be I do something wrong?
I need to hide arrow Icon layer of PartialTwoPort from on Icon layer in my model?!
Re: New Icons?
I try to change annotation according Modelica Specification 3.3. rev 1
so I have code with "IconMap":
Code:
model PartialTwoPort
import Modelica.Icons.Model;
extends Modelica.Icons.Model;
extends Modelica.Fluid.Interfaces.PartialTwoPort annotation(IconMap(extent = {{-100, -100}, {100, 100}}, primitivesVisible = false), DiagramMap(extent = {{-100, -100}, {0, 0}}, primitivesVisible = true));
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end PartialTwoPort;
- Index
- » Programming
- » Modelica Language
- » New Icons?