Hi Uffe,
It seems to be working for me.
Here is a script that shows notes or not depending on the settings for a Diagram or the Element Feature Visibility properties.
The 'NotesVisible' is true if either the Diagram > Element Properties has Notes ticked (right-click on a blank part of the diagram and select properties, then Elements)
OR
The Feature and Compartment Visibility of an Element on the Diagram has the Notes ticked. (right-click on an element on the diagram and select 'Features and Properties > Feature and Compartment Visibility').
shape main
{
layouttype="border";
editablefield="name";
v_align="top";
h_align="left";
RoundRect(0,0,100,100,10,10);
addsubshape("namePanel","n");
if (HasProperty('NotesVisible'))
{
addsubshape("notesPanel","center");
}
shape namePanel
{
layouttype="border";
preferredheight=20;
addsubshape("padding","n");
addsubshape("padding","s");
addsubshape("padding","e");
addsubshape("padding","w");
addsubshape("name","center");
shape name
{
v_align="top";
h_align="center";
printwrapped("#name#");
}
}
shape notesPanel
{
layouttype="border";
preferredwidth=100;
if(HasProperty('NotesVisible','true'))
{
addsubshape("padding","n");
addsubshape("padding","s");
addsubshape("padding","e");
addsubshape("padding","w");
addsubshape("notes","center");
}
shape notes
{
v_align="top";
h_align="left";
printwrapped("#notes#");
}
}
shape padding
{
preferredheight=6;
preferredwidth=6;
}
}