Help to put an icon on a topic with a macro.

Georgia shared this question 18 days ago
Discussion Open

I want to put an icon on a topic with a macro so i write :
mytopic.Icons.AddCustomIconFromMap("Couple") but i doesn't work and i don't understand why. 
My capture is my template. And my capture 2 is a part of my macro.

Replies (3)

photo
2

Hello Georgia

The parameter for the method Icons.AddCustomIconFromMap() is the custom icon signature, not the icon label.

This thread might help:
https://community.mindmanager.com/topic/2928-help-needed-with-a-macro-code-to-add-a-marker-icon

photo
1

Title: How to detect if a custom icon is already in the map before adding?

Dear Sir,

I’ve read your guidance about AddCustomIconFromMap(signature) vs AddCustomIcon(path), and I understand that each time I use AddCustomIcon(path), it creates a new icon instance with a unique CustomIconSignature, even if it’s the same .ico file.

I’m trying to write a macro that:

  1. Checks whether the icon (e.g. anki.ico) is already in the map
  2. If not, adds it from file
  3. If yes, reuses it using AddCustomIconFromMap(signature)

But since the CustomIconSignature changes with each import, is there any reliable way to identify if the icon already exists in the map — by label, path, or some form of comparison?

Any advice on the best way to handle this detection logic would be really appreciated!

Thanks in advance,

photo
2

Each time a custom icon is added to the map using AddCustomIcon(path), it has the same signature. In fact the signature can also be found with Utilities.GetCustomIconSignature(path).

photo
photo
1

Title: Better Way to Insert Multiple Icons via Macro?

Hi all,

I've written a macro to insert a custom icon and added it to the context menu — works fine. But I want to do this for 20+ icons, and the context menu quickly gets overloaded.

Is there a cleaner way to:

  1. Use one macro to choose from multiple icons (popup, dropdown, etc.)?
  2. Insert both built-in and custom icons programmatically (not hardcoding each one)?
  3. Organise multiple icon macros better — maybe in a custom ribbon or grouped context menu?

Open to any suggestions or code snippets. Thanks!

photo
2

If you add stock and custom icons to the Map Index, organised into groups, you can use the existing Insert > Icons menu in the ribbon. This will show previews of icons. To make this menu easier to use, it is a good idea to also clean out unused markers and groups from the Map Index. The icons collection can be transferred between maps via the Marker List, or added to the map template.

Leave a Comment
 
Attach a file
You can't vote. Please authorize!