Graphical Icon Editor Overview
Create and edit mask icon of a block in a graphical environment. The features in the Graphical Icon Editor help you to easily create icons. You can also create and edit the block mask icons using a set of drawing commands. For more information, see Mask Display and Initialization Commands.
You can launch the Graphical Icon Editor from the Mask Editor. In the Mask Editor, select the Icon tab. In the toolstrip, in the Authoring section, select Graphical. Using the Graphical Icon Editor, you can:
Preview the icon to check how it appears when the icon is horizontally stretched, flipped, or scaled.
Use Grid and Snap to grid to achieve precisely positioned icon elements.
Name the elements and hide, lock, arrange, and regroup them in the icon.
Use the Parts feature to render multiple variations of the same block. See Render Multiple Variations of Same Block Icon Using Parts for more information.
Hide or unhide specific elements in the icon based on conditions on the block parameters or mask parameters. See Hide or Unhide Elements in the Icon Based on Block Parameters or Mask Parameters for more information.
Position each element on the icon relative to the canvas. See Position Elements Relative to Other Elements Using Layout Constraints for more information.
Edit Properties of Block Mask Icon and Its Elements
The graphical mode of authoring has a set of tabbed panes that help you to author block mask icons. The options available in these tabbed panes are context sensitive.
Icon — Use the options in the Icon tab to control the properties of the icon such as the canvas height and width.
Element — All the properties specific to an element of the icon are available in the Element tab, for example, alignment options and transformation options.
Icon Toolstrip
Section | Property | Functionality |
---|---|---|
Import | Import Icon Part | Import a part into the icon. |
Import Icon | Import a new icon. | |
Save | Save Mask | Save the mask. |
Save image file with model | Select to save the mask icon with the model. | |
Authoring Mode | Toggle editor | Switch between the command and graphical editors. |
Canvas | Height | Set the height of the canvas. |
Width | Set the width of the canvas. | |
Drawing Aids | Grid and Snap to grid | Enable these options to create precisely positioned elements. These options help you to visualize the number of pixels each element occupies in the icon. Snap to grid allows enables you to snap the element to the nearest grid line. |
Grid Size | Control the spacing between the grid lines. | |
Grid Color | Select a color for the grid. | |
Smart Guides and Rulers | Use smart guides and rulers to align or position an element with respect to other elements in the icon or the canvas. | |
Port Grid | Display port grids to align elements with respect to the ports. | |
Parts | Add | Add a new part to the icon. |
Duplicate | Duplicate an existing part. | |
Delete | Delete an existing part. | |
Configuration | Ports | Define the number of ports on the left, right, top, and bottom of the icon. |
Dynamization | Add Dynamism | Add dynamic capabilities to the icon such as setting visibility conditions, parametrize text, and, repeating icon elements. |
Preview | Preview in Model | Visualize the icon in its original scale and after transformations such as scaling, horizontal and vertical stretching, and clockwise and counterclockwise rotation. You can also preview the icon with parameter variations and width height variations. |
Element Toolstrip
Section | Property | Functionality |
---|---|---|
Shape | Stroke, Stroke Width, Bold, Italics, Underline, and Fill | Define the visual appearance of elements by specifying these properties. |
Arrange | Group and Ungroup | Group and ungroup elements in the icon. |
Flip Horizontal | Flip the selected element horizontally. | |
Flip Vertical | Flip the selected element vertically. | |
Order | Send Backward | Send the element one level backwards. |
Send to Back | Send the element to the back. | |
Bring Forward | Bring the element one level forward. | |
Bring to Front | Bring the element to the front. | |
Align | Align Left | Align the selected elements to the left. |
Align Horizontal Center | Align the selected elements to the horizontal center. | |
Align Right | Align the selected elements to the right. | |
Align Bottom | Align the selected elements to the bottom. | |
Align Top | Align the selected elements to the top. | |
Align Vertical Center | Align the selected elements to the vertical center. | |
Port Binding | Bind Port or Unbind Port | Bind or unbind port labels and icon elements to a port. Binding the elements to the port enables to inherit the style from the port. For example, the color codes associated with the port of a block gets inherited by the element. To bind the port and label or element, select the port and the label or element. Specify the port using Select Port. To find the number of elements bound to a port, click the port, which highlights all the elements bound to the port. You can bind multiple elements to a port, but you cannot bind a single element to multiple ports. Select Unbind Port to unbind a label or element to a port. |
Icon Properties Pane
Design tab | ||
Section | Property | Functionality |
Transform | H and W | Set the height and width of the canvas. Remove the lock to change the height and width of the canvas without preserving the aspect ratio between height and width. |
Icon Dynamization | Visibility | Set visibility condition for the icon. Visibility conditions support JavaScript expressions only. |
Render tab | ||
Section | Property | Functionality |
General | Frame | Set the frame shape to any of the available shapes such as
Rectangle , Circle ,
Ellipse , Triangle ,
Trapezium , or Pentagon . |
None — The default shape is retained and does not show a
frame for the block. | ||
Transform | Rotate | Set this option to rotate the icon along with the block. |
Resize | Off — Icon retains its original size when the block
resizes. | |
On — Icon resizes to fit to the block. | ||
Shrink Only — Icon resizes to fit to the block while
shrinking but not otherwise. | ||
Stroke Behavior | Normalize Width | On — Select this option to set the stroke width of all the
elements to 1 pixel. |
Scale With Ports | On — Select this option to scale the stroke width of the
element by the style of the line that is connected to the port that is associated
with this element. | |
Scale on Zoom | On — Select this option to increase the stroke width when
the canvas is zoomed in and decrease the stroke width when the canvas is zoomed
out. | |
Scale on Resize | On — Scale stroke linearly on resizing icon. | |
Off — Maintain constant stroke width on resizing
icon. | ||
Shrink Only — Scale stroke linearly when the icon shrinks
and do not scale when icon is enlarged. | ||
Appearance | Foreground | Allow — Change foreground color of the icon. The foreground
color can be changed by right-clicking the context menu on the Simulink® canvas. |
Disallow — Retain the original color of the canvas even when
it is changed by right-clicking the context menu on the Simulink canvas. | ||
Inherit from Ports — Use the color of the port associated
with this element as the foreground color. | ||
Background | Allow — Change background color of the icon. The background
color can be changed by right-clicking the context menu on the Simulink canvas. | |
Disallow — Retain the original color of the canvas even when
it is changed by right-clicking the context menu on the Simulink canvas. | ||
Transparent — Use a transparent background for the block.
This option is selected by default for Simscape™ blocks. |
Element Properties Pane
Design tab | ||
---|---|---|
Section | Property | Functionality |
Transform | X, Y | Set the X and Y coordinates of the element. |
W, H | Set the width and height of the element. Remove the lock to change the width and height of the element without preserving the aspect ratio. | |
Angle | Specify an angle between -360 to 360 to rotate the element to the specified angle. | |
Flip horizontally | Flip the element horizontally. | |
Flip vertically | Flip the element vertically. | |
Corner radius | Define the radius of an element's corners. | |
Format | Fill | Select a color to fill the element and enter a value between 0 to 1 to adjust the transparency of the color. |
Stroke | Select a stroke color and enter a value between 0 to 1 to adjust transparency of the stroke color. | |
Stroke style | Enter the stroke width and select the stroke style. | |
Cap type | Select the style for the end of the line or path. | |
Join type | Select the style for the joints for the path element. | |
Start type | Select the start arrow head type. Toggle to fill the arrow head and then select the size of the arrow head. | |
End type | Select the end arrow head type. Toggle to fill the arrow head and the select the size of the arrow head. | |
Text | Font Size | Select the size of the text from the available options. |
Style | Bold, italicize, underline, or strike through the text on the icon. | |
Letter case | Choose the font casing. You can also format the text as superscript or subscript. | |
Fill | Select the color for the text. You can also choose the transparency of the text. | |
Stroke | Select the color for the border of the text. You can also choose the transparency for the border of the text. | |
Render tab | ||
Transform | Rotate | With Parent — Rotate the element with its parent. |
Readable — Maintain readable text element. The text appears
from left to right or bottom to top without mirrored. | ||
Fixed — Maintain orientation of the element even if the
block is rotated. | ||
With Ports — Rotate the element along with the port. | ||
Resize | On — Scale linearly along with parent when the icon is
resized. | |
Off — Maintain the size of the element when the icon is
resized. | ||
Shrink Only — Shrink the element linearly when its parent
shrinks but maintains the size when its parent is enlarged. | ||
Adaptive — Scale port labels appropriately along with the
block. | ||
Resize Limit | Set the maximum limit to which the element is resizable. | |
Horizontal Scaling | On — Scale the element horizontally along with the
block. | |
Off — Maintain the width of the element. | ||
Shrink Only — Shrink horizontally when its parent shrinks
but maintain the size when its parent is enlarged. | ||
Vertical Scaling | On — Scale the element vertically along with the
block. | |
Off — Maintain the height of the element. | ||
Shrink Only — Shrink vertically when its parent shrinks but
maintain the size when its parent is enlarged. | ||
Scale On Zoom | On — Scale the element linearly when the canvas is
zoomed. | |
Off — Maintain the size of the element when the canvas is
zoomed. | ||
Shrink Only — Shrink the element when the canvas is zoomed
out and maintain its size when the canvas is zoomed in. | ||
Stroke Behavior | Normalize Width | Inherit — Inherit the style from the icon. If the element is
part of a group then it inherits the style from its parent element. |
On — Set the stroke width of all the elements to 1
pixel. | ||
Scale With Ports | Inherit — Inherit the style from the icon. If the element is
part of a group then it inherits the style from its parent element. | |
On — Scale the stroke width of the element by the style of
the line that is connected to the port that is associated with this element. | ||
Scale On Zoom | Inherit — Inherit the style from the icon. If the element is
part of a group then it inherits the style from its parent element. | |
On — Scale the stroke width of the elements when the canvas
is zoomed out. Maintain a constant stroke width when the canvas is zoomed
in. | ||
Scale On Resize | Inherit — Inherit the style from the icon. If the element is
part of a group then it inherits the style from its parent element. | |
On — Scale element's stroke linearly on resizing
icon. | ||
Off — Maintain constant stroke width of the elements on
resizing icon. | ||
Shrink Only — Scale stroke of the elements linearly when the
icon shrinks and do not scale when icon is enlarged. | ||
Element Dynamization | ||
Visibility | Set visibility condition for the element. Visibility conditions support JavaScript® expressions only. | |
Repeat | Port Position | Repeat elements on each port in the icon.
|
Set Position | Set the alignment of the element. Align the element to the Left of
the block , Right of the block ,
Top of the block , Bottom of the
block , or Center of the block . You can
also set the Offset for the elements from the port. | |
Text Dynamization | ||
Visibility | Set visibility condition for the text element. Visibility conditions support JavaScript expressions only. | |
Repeat | Port Position | Repeat elements on each port in the icon.
|
Set Position | Set the alignment of the element. Align the element to the Left of
the block , Right of the block or
Center of the block . You can also set the
Offset for the elements from the port. | |
Text | Dynamic Text |
|
Editing Behavior | Edit Handler— Select Parameter ,
if you want to edit the value of the block parameter in the block icon itself and as
a result the block parameter value in the mask is also updated. Select
MATLAB Handler if you want to write MATLAB® code to edit the block parameter value. | |
Appearance | Inherit Background Color | Select this option to set the fill color of a closed shape to the background color selected from the block context menu. The block background remains transparent. Clear this option to set the fill color of a closed shape to the color selected from the Fill palette in the Format section under the Design tab of the Element Properties pane. If you select a fill color first, the Inherit Background Color check box is cleared by default. To enable this option, set the Background of the block to Transparent under the Render tab of the Icon Properties pane and select a closed shape in the Icon Editor canvas. |
Drawing Tools
Tool | Functionality |
---|---|
Path | Create the desired shape using the Path tool. |
Rect | Draw a rectangle or square using the Rect tool. |
Ellipse | Draw an ellipse or circle using the Ellipse tool. |
Line | Draw lines using Line tool. |
Curvature | Simplify path creation. To draw curves, click the canvas in two separate locations to create anchor points. Drag the center point to draw the curve. Drag the edge points of the curve to enlarge it. You can also rotate the curve clockwise or anticlockwise to form loops. |
Equation Tool | Write equations using LaTeX markup. This tool is similar to the equation tool present in MATLAB and Simulink. |
Edit Shape | Use the Edit Shape tool to edit all supported shapes, such as rectangles, ellipses, lines, and paths. To edit a shape, select the Edit Shape tool in fixed palette above the canvas and click an element. All edit points that form the shape appear. |
Scissor | Split a path or element on the canvas at an anchor point or along a segment. Click a point on the path you want to split. To modify the object, select the anchor points that are created due to splitting. |
Connector | Connect two or more open paths. This connection creates a single path element. Click the tool and drag to connect open paths. |
Note
Along with using these tools to draw shapes, you can use predefined shapes from Electrical, Translational, and Rotational libraries. You can also use basic shapes like Cylinder, Triangle, Axis, and Wave.
Element Browser
The element browser provides you the following functionalities:
Identify each element using a unique name.
Hide or unhide an element so that it does not get in the way while modifying other elements.
Lock or unlock an element so that the position of the element is locked in the icon.
Arrange elements within the group.
Delete elements.
Maintain a stack order for the elements.
Other Menu Options
Menu | Property | Functionality |
---|---|---|
Properties | Transform | Change the position, rotation, and corner radius of an element in the icon. |
Path Points | X and Y | Select an edit point in a shape, then modify the X and Y coordinates of the edit point. |
Point Type | Change between smooth point and corner point. | |
Symmetric Handles | Symmetrically move the handles of the edit point. |