主要内容

Graphical Icon Editor Overview

You can use the Graphical Icon Editor to create and edit masked block icons in a graphical environment. You can create block icons that change when you make changes to the underlying block, such as changing parameter values or resizing the block.

You can launch the Graphical Icon Editor from the Mask Editor by selecting the Icon tab. Using the Graphical Icon Editor, you can:

graphical icon editor home

Graphical Icon Editor Interface

To create and edit icons of masked blocks in a graphical environment, open the Graphical Icon Editor from the Mask Editor by selecting the Icon tab. The options available in these tabs are context-sensitive.

Toolstrip

Use the options in the toolstrip to set various properties of icon and icon elements. This table shows various sections available in the Toolstrip.

SectionPropertyFunctionality
SaveSave MaskSave the mask.
Authoring ModeGraphicalSwitch between the drawing command mode and graphical editor.
Icon FileFile NameDisplays name of the file.
Save with ModelIf turned ON, icon file will be saved with model else it will be saved as an external file on disk.
Save AsRename and save masked block icon.
ImportImport Icon Part — Import single or multiple parts into the icon.
Import Icon — Import a new icon.
Delete IconRemove the icon from the block. If the icon is saved with the model, the icon file will be removed.
Drawing AidsGridEnable 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 Snaps the element to the nearest grid line.
Port GridDisplay port grids to align elements with respect to the ports.
Grid SizeControl the spacing between the grid lines.
Grid ColorSelect a color for the grid.
Smart GuidesUse smart guides and rulers to align or position an element with respect to other elements in the icon or the canvas.
RulersUse rulers for precise positioning of an element.
PartsAddAdd a new part to the icon.
DuplicateDuplicate an existing part.
DeleteDelete an existing part.
View AllView all icon parts in a block icon.
ConfigurationPortsDefine the number of ports on the left, right, top, and bottom of the icon. These are only visual guides and do not add real ports to the actual block.
ConditionsView All ConditionsDisplay all the visibility conditions available on a block icon. You can also edit these conditions.
PreviewPreview in Model

Visualize the icon with:

  • Original size, without any transformations, and after transformations such as scaling, horizontal and vertical stretching, and different rotations and orientations

  • Parameter and width or height based variations

Icon Properties

Icon Properties pane appears on the right side of the Icon Editor and enables you to view and edit specific attributes of element, such as visibility conditions and relative positioning. This table shows various sections available in Icon Properties.

SectionPropertyFunctionality
TransformH and WSet 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.
FrameSet the frame shape to any of the available shapes, such as Rectangle, Circle, Ellipse, Triangle, Trapezium, or Pentagon. You can also customize the frame of the block. Select a shape and click the pencil icon button to modify the block frame.
None — The default shape is retained and does not show a frame for the block.
Visibility Condition Set a visibility condition for the icon. Visibility conditions support JavaScript expressions only.
Path PointsX and YSelect an edit point in a shape and then modify the X and Y coordinates of the edit point.
Point TypeChange between smooth point and corner point.
Symmetric HandlesSymmetrically move the handles of the edit point.
Behavior in Simulink EditorRotateSet this option to rotate the icon along with the block.
ResizeOff — Icon retains its original size when the block resizes.
On — Icon resizes to fit the block.
Shrink Only — Icon resizes to fit to the block while shrinking but not otherwise.
Resize LimitSet the maximum limit to which the element is resizable.
ForegroundAllow — Change foreground color of the icon. You can change the foreground color by right-clicking the Simulink® canvas and using the context menu.
Disallow — Retain the original color of the canvas on the icon even when the canvas color changes.
Inherit from Ports — Use the color of the port associated with this element as the foreground color.
BackgroundAllow — Change background color of the icon. You can change the background color by right-clicking the Simulink canvas and using the context menu.
Disallow — Retain the original color of the canvas on the icon even when the canvas color changes.
Transparent — Use a transparent background for the block. This option is selected by default for Simscape™ blocks.
Normalize WidthOn — Select this option to set the stroke width of all the elements to one pixel.
Scale With PortsOn — 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 ZoomOn — 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 ResizeOn — Scale stroke linearly on resizing the block.
Off — Maintain constant stroke width on resizing the block.
Shrink Only — Scale stroke linearly when the block shrinks and do not scale when icon is enlarged.

Element Properties

Element Properties pane appears on the right side of the Icon Editor on selecting an element. It enables you to modify the visual characteristics of a selected element, such as its format and behavior in Simulink Editor. This table shows various sections available in Element Properties.

SectionPropertyFunctionality
TransformX, YSet the X and Y coordinates of the element.
W, HSet the width and height of the element. Remove the lock to change the width and height of the element without preserving the aspect ratio.
AngleAdjust the angleSpecify an angle in degrees to rotate the element to the specified angle.
Flip horizontallyflip horizontallyFlip the element horizontally.
Flip verticallyflip verticallyFlip the element vertically.
Corner radiusset corner radiusAdjust the radius of the corners of an element.
FormatFillSelect a color to fill the element and enter a value between 0 and 1 to adjust the transparency of the color.
StrokeSelect a stroke color and enter a value between 0 and 1 to adjust transparency of the stroke color.
Stroke styleEnter the stroke width and select the stroke style.
Cap typeSelect the style for the end of the line or path.
Join typeSelect the style for the joints for the path element.
Start typeSelect the start arrow head type. Toggle to fill the arrow head and then select the size of the arrow head.
End typeSelect the end arrow head type. Toggle to fill the arrow head and then select the size of the arrow head.
Font SizeSelect the size of the text from the available options.
Scale on ResizeOn — Scale stroke linearly on resizing the block.
Off — Maintain constant stroke width on resizing the block.
StyleMake text element bold, italic, underline, or strike through on the icon.
Visibility Condition Set a visibility condition for the element. Visibility conditions support JavaScript® expressions only. You can create a visibility condition using the Condition Builder option.
Parameter AssociationParameter or ExpressionSelect the parameter that appears in place of the text on the canvas or evaluate an expression using JavaScript.
Evaluate parameterEvaluate the parameter displayed on the block.
Allow editing on the blockOption to edit the value of the parameter on the block icon.
Trim textIf the text exceeds the boundaries of the block, it is truncated and an ellipsis (...) appears at the end to indicate the overflow.
Pin at canvas centreThe text element remains centered on the canvas at all times, regardless of the block size or the content of the text.
Relative PositioningSourceSelect the specific shape or anchor point that you want to move or position.
Relative toChoose the reference object or block boundary that determines the source's position.
OffsetSpecify the exact horizontal and vertical distance to maintain between the source and the reference point.
Dynamic Port ElementsPortsRepeat elements on right or left ports.
Generation AlgorithmIncrement — Increment the text element. For example, if the text element is w and you select Increment as the Generation Algorithm, the text element increments to w1, w2, and so on.
Duplicate — Duplicate an icon element.
Parameter Value — Display the parameter value at the ports.
Parameter NameSelect the parameter whose value will be displayed at the ports. This option is applicable only to text elements.
Behavior in Simulink EditorRotateWith Parent — Rotate the element with its parent.
Readable — Maintain a readable text element. The text appears from left to right or bottom to top without mirroring.
Fixed — Maintain the orientation of the element even if the block is rotated.
With Ports — Rotate the element along with the port.
ResizeOn — 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 LimitSet the maximum limit to which the element is resizable.
Horizontal ScalingOn — Scale the element horizontally along with the block.
Off — Maintain the width of the element.
Shrink Only — Shrink the elements horizontally when its parent shrinks but maintain the size when its parent is enlarged.
Vertical ScalingOn — Scale the element vertically along with the block.
Off — Maintain the height of the element.
Shrink Only — Shrink the elements vertically when its parent shrinks but maintain the size when its parent is enlarged.
Scale On ZoomOn — 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.
Normalize WidthInherit — 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 one pixel.
Scale With PortsInherit — 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 ZoomInherit — 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 ResizeInherit — 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 of the element 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 the icon is enlarged.

Drawing Tools

Drawing Tools pane appears on the left side of the Icon Editor and this collection of tools allows you to create custom icons using basic shapes, paths, and equations. This table shows various tools available.

ToolFunctionality
Draw
PathDraw any desired custom shape. Click to add anchor points for straight lines, or click and drag to form smooth curves.
LineDraw lines.
ArrowDraw an arrow.
RectDraw a rectangle or square.
EllipseDraw an ellipse or circle.
TriangleDraw a triangle.
PolygonDraw a polygon. Specify the number of vertices to create a polygon with the desired number of sides.
CylinderDraw a cylinder.
WaveDraw a wave.
CurvatureSimplify 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.
Insert
TextInsert a text element.
Port LabelSpecify the port label that will appear on the assigned port.
ImageInsert an image into the icon by browsing for an image file and placing it on the canvas.
EquationWrite equations using LaTeX markup. This tool is similar to the equation tool in MATLAB® and Simulink.
Shape FinderSearch for and insert shapes in a way similar to the quick insert feature on the Simulink canvas. Double-click on the canvas and type the name of the shape that you want to insert.
Edit ShapeEdit 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.
ScissorSplit 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.
ConnectorConnect two or more open paths. This connection creates a single path element. Click the tool and drag to connect open paths.

Note

Along with these tools to draw shapes, you can use the Shape Finder tool to browse and use predefined shapes from the Electrical, Translational, and Rotational libraries. You can also use basic shapes like Cylinder, Triangle, Axis, and Wave.

Element Browser

Element Browser pane appears on the left side of the Icon Editor. Use the Element Browser to:

  • 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.

See Also

Topics