Editor to assign custom icons

If you have questions or comments concerning any non-support related 3Dconnexion topic, please use this forum.

Moderator: Moderators

spartan00j
Posts: 1
Joined: Fri Nov 29, 2019 8:26 am

Re: Editor to assign custom icons

Post by spartan00j » Fri Nov 29, 2019 8:34 am

So has anyone figured this out?

MirageC
Posts: 3
Joined: Fri Jan 24, 2020 9:55 pm

Re: Editor to assign custom icons

Post by MirageC » Fri Jan 24, 2020 10:13 pm

Success!

I managed to insert customized icons for my Fusion 360 macros! :D

Step by step... hoooo baby!!! (No seriously)

A) Creating the icons and placing them into the right folder.
1 - Do a print screen of you application where your desired icon appears

2 - Using your favorite picture editing tool, crop and redimension to 24 X 24 Pixels

3 - Save as in the Pictures directory (do not try to save directly to the here below location, windows will not let you. Also no network drive path allowed)

4 - Copy the picture you just saved and paste it into: C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\Cfg\Images\3DxService

B) Modifying .xml file to link your macro to the right icon.
5 - Copy the following file to your Documents folder. C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\Cfg\[your program].xml (windows will not let you edit and save directly into the Program Files directory. )

6- Open this file with notepad or notepad++

7 - Locate the image association section: example
<ButtonAction Type="Macro">
<ID>Extrude</ID>
<Name>Extrude</Name>
<Image>
<Source>[driver_images:Generic_Extrude.png]</Source>
</Image>
</ButtonAction>


8 - create a new entry for each of you macros: example
<ButtonAction Type="Macro">
<ID>NewMacro</ID>
<Name>Extrude</Name>
<Image>
<Source>[driver_images:NewMacro.png]</Source>
</Image>
</ButtonAction>


9 - Save the file.

10 - Copy paste this new xml file over the existing one in: C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\Cfg\

Your done!
:)
Attachments
customicons.jpg
customicons.jpg (60.83 KiB) Viewed 22695 times

Phil999
Posts: 409
Joined: Tue Jun 30, 2009 5:20 am

Re: Editor to assign custom icons

Post by Phil999 » Mon Jan 27, 2020 2:32 am

well done, thank you.
Space Navigator x2, Space Pilot, Space Pilot Pro, SpaceMouse Enterprise

MirageC
Posts: 3
Joined: Fri Jan 24, 2020 9:55 pm

Re: Editor to assign custom icons

Post by MirageC » Mon Jan 27, 2020 7:04 am

Erratum! see correction in red. (cannot edit my post)
MirageC wrote:
Fri Jan 24, 2020 10:13 pm
7 - Locate the image association section: example
<ButtonAction Type="Macro">
<ID>Extrude</ID>
<Name>Extrude</Name>
<Image>
<Source>[driver_images:Generic_Extrude.png]</Source>
</Image>
</ButtonAction>


8 - create a new entry for each of you macros: example
<ButtonAction Type="Macro">
<ID>NewMacro</ID>
<Name>NewMacro</Name>
<Image>
<Source>[driver_images:NewMacro.png]</Source>
</Image>
</ButtonAction>

jwick
Moderator
Moderator
Posts: 2899
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Editor to assign custom icons

Post by jwick » Mon Jan 27, 2020 9:24 am

<ID> is used for assignments. It is not localized, nor visible.
<Name> is what you see in the GUI, on the LCD, etc. It is localizable.

You can put your image files somewhere else. Most users won't have write access to the directory in Program Files.

MirageC
Posts: 3
Joined: Fri Jan 24, 2020 9:55 pm

Re: Editor to assign custom icons

Post by MirageC » Mon Jan 27, 2020 10:33 am

jwick wrote:
Mon Jan 27, 2020 9:24 am
<ID> is used for assignments. It is not localized, nor visible.
<Name> is what you see in the GUI, on the LCD, etc. It is localizable.

You can put your image files somewhere else. Most users won't have write access to the directory in Program Files.
Thank you jwick :)

Would these users have other means of changing the .XML file without write access to Program File? Can the XML file be relocated elsewhere?

jwick
Moderator
Moderator
Posts: 2899
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Editor to assign custom icons

Post by jwick » Tue Jan 28, 2020 1:07 am

There are a couple of options without going to deep here.

1) All changes the user makes through the GUI are kept under %appdata%\3Dconnexion\3DxWare\Cfg. These files can be freely edited by the user. You can add these ButtonActions there.

2) A new default cfg file can be put into %PROGRAMDATA%\3Dconnexion\3DxWare\Cfg and it will be used instead of the one in Program Files. In fact, if you don't like our defaults for an app, copy our default file from PF to PD and make all the changes you want, and the user will have a new set of defaults.

In all cases, all user changes are in %appdata%. There's nothing magical about those files. You can edit them with notepad in the same way our GUI edits them. Of course, the GUI knows something about the syntax. If you edit manually you may need to experiment for some of the esoteric areas.

But I was specifically referring to the images, not the cfg files. But you are correct, you have to edit both. The images/icons/pngs are referenced through CURIEs. You see this definition of driver_images (xmlns:driver_images="./images/3DxService/"). This, as you figured out, refers to a subdirectory. But it is a subdirectory under the cfg dir in Program Files. I'm pretty sure (I'd have to check) that this relative syntax can also be used under ProgramData, and maybe AppData. If nothing else, a full path can be used (e.g., "C:/tmp/my3DxIcons/").

Yes, I know, the GUI should do all this for you... I never intended to have people editing XML files.

BLANKOTA
Posts: 1
Joined: Sat Mar 07, 2020 1:17 pm

Re: Editor to assign custom icons

Post by BLANKOTA » Sat Mar 07, 2020 1:18 pm

AxeGunKnife wrote:
Thu Jan 18, 2018 2:50 pm
I, too, could not customize the icons in the radial menu. I also asked the developer questions in other branches. But .... they did not answer me.
1) Custom mapkey icons are not displayed on the display, only the default (smiley) icon. I'd love to to see this implemented, since I have made many custom mapkey icons. This might be a Creo specific issue?

Durahl
Posts: 36
Joined: Tue Feb 01, 2011 1:34 am
Location: 3rd Planet

Re: Editor to assign custom icons

Post by Durahl » Sat Dec 26, 2020 10:36 am

Eyy... Would you look at that! So much better than not having any icons...
20201226_172444811_iOS.jpg
20201226_172444811_iOS.jpg (204.3 KiB) Viewed 3223 times
I think the only icing on the cake would be the Screen changing depending on the workspace I'm working in ( Sketching, Solid, Surface, etc... )
For now, I went with the Solid one as it requires the use of the SpaceMouse the most while Sketching can mostly be done with the Keyboard.

Repier37
Posts: 5
Joined: Wed Mar 31, 2021 3:19 pm

Re: Editor to assign custom icons

Post by Repier37 » Wed Mar 31, 2021 4:16 pm

I made a very simple editor to add icon to the SpaceMouse for software that don't do it automatically
Here are the step to do it :
1. Assign shortcut to the commands in your app (Fusion/TopSolid...)
2. Create the corresponding macros using the official editor
3. Backup your configuration file :D
4. Launch the 3DxConfigurationEditor
3DxConfigurationEditor.zip
(11.09 KiB) Downloaded 82 times
5. Select the configuration file to modify
6. The list of existing macro is loaded, select the one you want to add icon to.
7. select the icon to add
8. Validate
9. Your macro has an icon. In the editor the macro will be found under the App folder name has well has in the macros folder
VueEditeur3Dx.png
VueEditeur3Dx.png (23.1 KiB) Viewed 2108 times
I have only tested it on my device and on TopSolid, therefore I don't guarantee it will work with other device or other software (I don't even guarantee it will work at all :D :D ), but I don't see why it would not.

For those interested, you can find the source code here :
https://github.com/repier37/3dxConfigurationEditor

jwick
Moderator
Moderator
Posts: 2899
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Editor to assign custom icons

Post by jwick » Thu Apr 01, 2021 8:05 am

Repier37,

Do you want it listed in both places?
It doesn't make a difference to me if you do (and there's no harm in having it in multiple places). You can also make your own category.
But if it is a bug, then I'd like to look at it.

Repier37
Posts: 5
Joined: Wed Mar 31, 2021 3:19 pm

Re: Editor to assign custom icons

Post by Repier37 » Thu Apr 01, 2021 8:17 am

jwick,

It is more a bug than a feature :D. However I think it is necessary to be able to modify the macro, but the entry with icon does not seem editable.
But this program only do thing I have figured out by trial and error, by looking at existing conf file, and some information on this forum. So there might be a better way.

In fact what the program does is very simple :
Look for the <MacroTable> node in the configuration file.
List the <ID> of each <MacroEntry> in the combo.

To add the icon :
Add a new <ButtonAction type="App"> node in the <ButtonActions> node
With <ID> equals to the selected macro ID
With an <ImageSource> node equals to the selected image path.

There is a lot of room for improvement, like checking if the macro already has an icon.

Feel free to check it and to improve it :).

Repier37
Posts: 5
Joined: Wed Mar 31, 2021 3:19 pm

Re: Editor to assign custom icons

Post by Repier37 » Fri Apr 02, 2021 4:26 am

It's more a bug than a feature.
However, I think it is necessary to keep the possibility to edit the macro after an icon was applied to it. But it seems that in the "App" folder it is not possible (kind of make sense).

All this editor does is based on some trial and errors I did with the configuration file. Therefore there is a lot of room for improvement. Feel free to check the code and to point out the issues in it. If you had some documentation about the config file, it would help a lot too

jwick
Moderator
Moderator
Posts: 2899
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Editor to assign custom icons

Post by jwick » Mon Apr 05, 2021 1:32 am

Bug or feature, one of them. I probably add all the Macros from the Macro table into the button category.
Since you are creating a Type="App", it adds it to the App category (e.g., TopSolid). If you said it was Type="Macro", it might detect the collision. I don't know if it is smart enough to choose the ButtonAction over the Macro with the same name.

It might work. See in Base.xml:

Code: Select all

    <ButtonAction Type="Macro">
      <ID>Macro_Copy</ID>
      <Name>STR_COPY</Name>
      <Image>
        <Source>[driver_images:Macro_Copy.png]</Source>
      </Image>
    </ButtonAction>
You should not change the default file. Your changes will get thrown out, without warning, on the next driver update.
If you want to change a ButtonAction from a default file, you can make a copy of it in your user file. It should choose the details of that one.

Repier37
Posts: 5
Joined: Wed Mar 31, 2021 3:19 pm

Re: Editor to assign custom icons

Post by Repier37 » Tue Apr 06, 2021 10:45 am

Thanks for your reply, and sorry for the double post.

I have tried what you suggested by replacing the line :
<ButtonAction Type="App">
by
<ButtonAction Type="Macro" xsi:type="ButtonAction_Macro">

But got an error stating that an unknown namespace prefix was specified in the configuration file (version 17.7.2).
I have downloaded the latest driver from your website : 3DxWare64_v10-7-2_r3314
Any idea what's wrong?

I then tried removing the xsi:type="ButtonAction_Macro", as I suppose this was causing the error, no error then, but I still have both button listed (in the Macro folder this time obviously).
Capture d’écran 2021-04-06 183254.png
Capture d’écran 2021-04-06 183254.png (3.11 KiB) Viewed 2028 times
Notice that only the entry without icon is modifiable.
I think the best would be to have it listed in the App folder (eg. Topsolid in my example), and to have the possibility to edit it here (and not having it in the macro folder).
I might add an option to select where to add macro entry, if people ask, if you had a list of the "Type" allowed in the xml that would be great.

I have also tried to enable creating the macro directly from my tool, has it would be convenient to create the macro and add the icon directly. Moreover, lot of programs allow exporting the preferences (including hotkeys), therefore it would be possible to parse those config file, and to create all the corresponding macro on the fly.
I have managed to create macro in my tool, I found that the keys are stored in the table using HID, however I am struggling with the keyboard layout. I am using an azerty keyboard, and when I type the key A, 3Dx stores the value "0x14" corresponding to the HID of the key "Q". How do you manage keyboard layout?

Post Reply