In
\Tools\Options\Contour plot\Custom\Custom colors I have my legend colors set as --
The following image shows a static analysis where the top surface of the cylinder is fixed and a negative pressure is applied to the bottom surface (the stud). This causes elongation in the negative direction as shown in the legend.
Generally, hot colors are used to indicate a large effect whereas cool colors indicate a small effect. In this case the colors are reversed so that red indicates near-zero displacement and dark purple indicates maximum displacement. I'm looking for some way to easily invert the colors. Taking the absolute value of the displacements gives the desired color distributions but then the legend is wrong since all displacement values are indicated as positive (next image). (Re-editing
\Tools\Options\Contour plot\Custom\Custom colors isn't really an option since this takes too much time and then interferes with "normal" legends.)
If there's no easy way to do this then perhaps an "Invert legend colors" option could be added to
\Solution\Deformed view settings.
Comments
I would rotate the whole model 180º.
There is a way to do this. My first response was probably too precipitated as sorted the problem immediately but for a more permanent solution you could create a custom color legend and save it inside the default model folder to be loaded automatically each time you create a new file. The “Custom” legends would contain the “Reversed colors” and will be saved permanently.
Custom file needs to be created in case you haven't. Tell Mecway the folder in Tools/Options/Defaults.
To invert the colors, edit the “Options/Contour Plot/Custom” colors. Delete any colors in case you have changed previously something and press ok.
Reopen “Custom” and you will have the standard range again. Use the up and down arrows to sort them upside down.
Press ok and save the file as Default.
Next time you create a file , Custom contour plot will contain the reversed color range.
This works --
However, it has a major shortcoming (as far as I can determine). Once this inverted color scheme is created, it is applied to all models. However, the original (non-inverted) color scheme may be desired for some models. In this case the inverted color scheme must itself be inverted to get back to the original color scheme; then the inverted color scheme is lost.
In what file are the legend colors stored? Then two different versions of this file could be saved, one with the normal colors and one with the inverted colors. Then either of these files could be renamed to become the active color file. Alternately, the colors section of this file could be copied-pasted as needed for the normal or inverted colors.
Regards
Your suggestion might work in some cases. However, I don't use the Rainbow for certain reasons. Instead, my "normal" colors are already customized and saved as Custom. Thus, what I need is two custom configurations -- normal and inverted.
I now remember that the colors are stored in user.config (in my case "C:\Users\HP\AppData\Local\Mecway_Limited\mecway.exe_StrongName_srenxo1oihmv3emikwtooe35mfwix3fi\16.0.8251.18890\user.config"). The custom colors there are --
<setting name="CustomColors" serializeAs="Xml"> <value> <ArrayOfColorListColor xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ColorListColor> <StringValue>#3A0073</StringValue> </ColorListColor> <ColorListColor> <StringValue>#3A0073</StringValue> </ColorListColor> <ColorListColor> <StringValue>#6419FF</StringValue> </ColorListColor> <ColorListColor> <StringValue>#6419FF</StringValue> </ColorListColor> <ColorListColor> <StringValue>#00C8C8</StringValue> </ColorListColor> <ColorListColor> <StringValue>#00C8C8</StringValue> </ColorListColor> <ColorListColor> <StringValue>#417800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#417800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#5BAC00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#5BAC00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#96BB00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#96BB00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#F1F800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#F1F800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#E79F00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#E79F00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#DF5600</StringValue> </ColorListColor> <ColorListColor> <StringValue>#DF5600</StringValue> </ColorListColor> <ColorListColor> <StringValue>#FF0000</StringValue> </ColorListColor> <ColorListColor> <StringValue>#FF0000</StringValue> </ColorListColor> </ArrayOfColorListColor> </value> </setting>
My default liml file (E:\Data\Mecway\Library\Modal_default_1.liml) has --
<liml version="15"> <analysis type="V30" solver="ccx" maxmode="5" /> <elset name="Default" color="-6710887" expanded="true" material="Material_set_mm_units" /> <mat name="Material_set_mm_units"> <geometric type="Plate" thickness="1 mm" /> <mechanical type="Isotropic" youngsmodulus="1 MPa" /> <density type="Simple" density="1 kg/m³" /> </mat> <formula name="Displacement_z[m]" displayunit="" fieldscalar="displacement_z[m]"> <unit exponents="+1">mm</unit> <formula>abs(u.z)/1.0</formula> </formula> <formula name="Displacement_x[m]" displayunit="" fieldscalar="formula"> <unit exponents="+1">m</unit> <formula>abs(u.x)/1.0</formula> </formula> <formula name="Displacement_y[m]" displayunit="" fieldscalar="formula(2)"> <unit exponents="+1">m</unit> <formula>abs(u.y)/1.0</formula> </formula> <formula name="Displacement_magnitude[m]" displayunit="" fieldscalar="formula(4)"> <unit exponents="+1">m</unit> <formula>sqrt(u.x^2 + u.y^2 + u.z^2)/1.0</formula> </formula> <formula name="Displacement_r[m]" displayunit="" fieldscalar="displacement_r[m]"> <unit exponents="+1">m</unit> <formula>abs( x*u.x + y*u.y ) / (sqrt(x^2+y^2) +1e-10)</formula> </formula> <formula name="Displacement_theta[m]" displayunit="" fieldscalar="displacement_t[m]"> <unit exponents="+1">m</unit> <formula>abs( x*u.y - y*u.x ) / (sqrt(x^2+y^2) +1e-10) </formula> </formula> <formula name="von_Mises_per_micron_peak" displayunit="" fieldscalar="formula(3)"> <unit exponents="-1+1-2">MPa</unit> <formula>vm/(1e6)</formula> </formula> <fieldvariable name="von Mises stress" displayunit="MPa" /> <fieldvariable name="displacement" displayunit="mm" expanded="true" /> <fieldvariable name="stress" displayunit="MPa" /> <solution> <analysis type="S30" solver="ccx" /> <elset name="Default" color="-6710887" expanded="true" /> </solution> </liml>
I don't see where the default liml file references the user.config file in order to pick up the custom colors in user.config.
mhh
<setting name="CustomColors" serializeAs="Xml">
.The custom colors apparently have no relation to "\Tools\Options\Defaults\.liml file" -- i.e., if this path is removed the custom colors are still displayed.
To create an inverted legend I created two color sets and then used the desired one as needed --
<setting name="CustomColors" serializeAs="Xml">
.For example, my Normal color set is --
<setting name="CustomColors" serializeAs="Xml"> <value> <ArrayOfColorListColor xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ColorListColor> <StringValue>#3A0073</StringValue> </ColorListColor> <ColorListColor> <StringValue>#3A0073</StringValue> </ColorListColor> <ColorListColor> <StringValue>#6419FF</StringValue> </ColorListColor> <ColorListColor> <StringValue>#6419FF</StringValue> </ColorListColor> <ColorListColor> <StringValue>#00C8C8</StringValue> </ColorListColor> <ColorListColor> <StringValue>#00C8C8</StringValue> </ColorListColor> <ColorListColor> <StringValue>#417800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#417800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#5BAC00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#5BAC00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#96BB00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#96BB00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#F1F800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#F1F800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#E79F00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#E79F00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#DF5600</StringValue> </ColorListColor> <ColorListColor> <StringValue>#DF5600</StringValue> </ColorListColor> <ColorListColor> <StringValue>#FF0000</StringValue> </ColorListColor> <ColorListColor> <StringValue>#FF0000</StringValue> </ColorListColor> </ArrayOfColorListColor> </value> </setting>
Note that the colors are listed in reverse order compared to how they are displayed in the legend. Thus, the first listed color (#3A0073; dark purple) is displayed at the bottom of the legend and the last listed color (#FF0000; bright red) is displayed at the top of the legend.
Save just the above section between
<setting name="CustomColors" serializeAs="Xml">..</setting>
for later use. I saved as Contour_custom_colors__normal.xml. (The xml extension isn't required. It could also be txt or whatever is convenient.)<setting name="CustomColors" serializeAs="Xml">
. The Inverted colors will overwrite the previous Normal colors. For example, the Inverted color set becomes --<setting name="CustomColors" serializeAs="Xml"> <value> <ArrayOfColorListColor xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ColorListColor> <StringValue>#FF0000</StringValue> </ColorListColor> <ColorListColor> <StringValue>#FF0000</StringValue> </ColorListColor> <ColorListColor> <StringValue>#DF5600</StringValue> </ColorListColor> <ColorListColor> <StringValue>#DF5600</StringValue> </ColorListColor> <ColorListColor> <StringValue>#E79F00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#E79F00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#F1F800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#F1F800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#96BB00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#96BB00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#5BAC00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#5BAC00</StringValue> </ColorListColor> <ColorListColor> <StringValue>#417800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#417800</StringValue> </ColorListColor> <ColorListColor> <StringValue>#00C8C8</StringValue> </ColorListColor> <ColorListColor> <StringValue>#00C8C8</StringValue> </ColorListColor> <ColorListColor> <StringValue>#6419FF</StringValue> </ColorListColor> <ColorListColor> <StringValue>#6419FF</StringValue> </ColorListColor> <ColorListColor> <StringValue>#3A0073</StringValue> </ColorListColor> <ColorListColor> <StringValue>#3A0073</StringValue> </ColorListColor> </ArrayOfColorListColor> </value> </setting>
Reload user.config in your text editor. Then save just the above section for later use. I saved as Contour_custom_colors__inverted.xml.
<setting name="CustomColors" serializeAs="Xml">..</setting>
and replace it with the alternate custom color code that you had previously saved. For example, if the current colors are Normal, then just replace these Normal colors with Inverted (e.g., the code that you had previously saved in Contour_custom_colors__inverted.xml). When you start Mecway, these new colors will be displayed for every model until you exit Mecway and restore the original Normal colors (e.g., from Contour_custom_colors__normal.xml).<setting name="CustomColors" serializeAs="Xml">
to<setting name="ZCustomColors" serializeAs="Xml">
. Note that only one color set can be named<setting name="CustomColors" serializeAs="Xml">
; all others must have some other temporary name. (See the attached file. Search to find CustomColors and ZCustomColors.)