Component Icons & Port Anchors
Applies to: CoModel cloud modeling & simulation platform (v1.6+; port matching rules have been stable since this version)
1. What this document covers
Every modeling component has an SVG icon, and port anchors on the icon mark where its external ports sit: when you drag the component into the graphical modeling area, the connection points align automatically to the anchor positions.
For where icons come from, how they are categorized, and how to assign them, see Component Icon System Overview. This page covers three things only:
- How anchors relate to ports (one rule)
- The recommended workflow for creating icons with anchors (no hand-written SVG required)
- How to audit and troubleshoot anchor problems
2. One core rule
Anchors map to ports by "port name", and the port name must match the component's actual port name character for character (case-sensitive).
- Match → the port renders at the position marked on the icon
- Mismatch → no error is raised and the icon still saves, but that port falls back to the default layout (stacked along the left and right edges), which will not match the icon's intended design

The platform derives port names from the component code. The two most common cases:
| Component form | Port names |
|---|---|
| Single port-pair components (resistors, capacitors, etc., using OnePort) | p (left), n (right) |
| Two port-pair components (using TwoPort) | p1, n1 (left side), p2, n2 (right side) |
For all other ports (e.g. the thermal port heat_port or the signal output y), the Ports table at the bottom of the component detail page is authoritative — you can open it from the Component Library or through Usage in the icon details.
Whenever a port name is uncertain, always trust the component detail's Ports table — never guess.
3. Creating icons with port anchors (recommended workflow)
3.1 First choice: create the icon from the component
To create an icon for a component that has no suitable one yet, you do not need to visit the Icons page first. Directly:
- Component list → open the component's Edit Meta Info dialog (available on the My MTK Components, FMU Components, and AI Components pages)
- Icon field → click New Icon
- The editor has already done three things automatically: port anchors generated from the component's ports (inputs on the left, outputs on the right), category pre-filled with the component's current category, and name pre-filled with the component name
- Design the graphics directly on the canvas and click Save
- The platform links the new icon to the component automatically and returns to the list, with a confirmation at the top — no manual assignment needed
This path guarantees anchor names match ports at the source, with no back-and-forth.
3.2 "Import ports from component" in the icon editor
While creating (or editing) an icon on the Icons page, click Import ports from component:
- The dialog's left side is the category tree (identical to the Component Library, including Uncategorized); the right side supports searching by name/description to locate the target component quickly
- Once a component is selected, anchors are generated in bulk from its port list
- After importing, drag each anchor to fine-tune its position; anchors snap when close to the icon edge
![]()
3.3 Adding anchors manually
Add port places anchors one at a time with hand-typed port names — check them against the rule in Section 2 or the component detail's Ports table, character for character. Best for components with one or two ports, or for filling in an individual extra port.
With any of these methods, anchor positions can be fine-tuned by dragging in the preview; anchors snap when close to the edge.
4. Assigning an existing icon to a component
The entry point is always the Edit Meta Info dialog on the component's page (My MTK Components / FMU Components / AI Components):
- No icon set: shows No icon set with Assign icon
- Icon set: shows the thumbnail and icon name, with Change and Remove
Clicking either opens the icon picker: the category tree on the left auto-navigates to the component's current category, and the icon grid on the right supports search by name. All changes take effect together when you click Save; if the selected icon was deleted by someone else, you are prompted to pick another.
5. Auditing the anchors of an existing icon
Icons page → click an icon card to open its details; the Port Anchors section lists all of the icon's anchors: port name, physical domain (colored by domain), and coordinates.
Combined with Usage — click any component that uses the icon to see its port definitions — comparing the two sides confirms whether names match character for character.
6. FAQ
Why do ports crowd the edges of the component node instead of sitting where the icon marks them?
A port name mismatch with the component's actual port name triggered the default layout fallback (see Section 2). Three checks:
- Open the component details and confirm the real port names in the Ports table
- Open the icon details and check the anchor names in the Port Anchors section
- Click Edit to rename anchors in the icon editor, or regenerate them with Import ports from component
What exactly are the port names of OnePort / TwoPort components?
Fixed: OnePort components use p, n; TwoPort components use p1, n1, p2, n2. Whatever the component is called (Resistor, Capacitor, Inductor, ...), the names are the same.
What about extra ports (e.g. HeatPort)?
Import ports from component generates them along with the rest; or add them manually with Add port, using the variable name from the code (e.g. heat_port).
What does the port domain (physical domain) do?
It decides the color of the port circle and the connection (see the color table in the overview document, Section 4); when unset, ports use the general gray-blue.
In one sentence: anchors match ports by name only, and only an exact, character-for-character match takes effect. Prefer Edit Meta Info → New Icon or Import ports from component and let the platform generate anchors, avoiding mismatches at the source.