07-10-2017 06:47 AM
Are the LoadCustomizedSettings and SaveCustomizedSetttings methods still supported by Geomedia 2016? We were trying to integrate a custom ribbon bar through API using the LoadCustomizedSettings and SaveCustomizedSetttings methods but it doesn't seem to work.
According to one of our customers, this was possible in GM6.1. and even in GM13.
I couldn't find any information regarding this topic in the documentation.
Thanks for your hints!
Solved! Go to Solution.
07-10-2017 03:01 PM
If you have a custom application, be sure to review the Install Application Command Tool section in the delivered Developer Documentation > Command Wizard Help. It says that "Once the application command has been installed, it can be associated to the ribbon bar through the Customize Ribbon command, or through XML configuration files during a product delivery".
You may also want to reivew GeoMedia Q&A topics:
I hope this information is helpful.
07-11-2017 12:46 AM
Thanks a lot for your reply.
I never created a custom command so I'm totally new to this topic. I looked through the Command Wizard Help but I couldn't find anything specifically about the LoadCustomizedSettings and SaveCustomizedSettings API Methods.
Actually, what we got from our client is a VB program which first starts GeoMedia with the Create Object method:
objGMApp = CreateObject("GeoMedia.Application")
objGMApp.Open(InputBox("Gws-File:", , "E:\GeoMedia\Geoworkspaces\USSampleData.gws"))
and then loads Customized Settings specified in a separate CustomizedRibbon.xml:
objGMApp.Visible = True
objGMApp.LoadCustomizedSettings(InputBox("XML-Ribbonfile:", , "E:\CustomizedRibbon.xml"))
"CustomizedRibbon.xml" should basically deactivate the visibility of the ribbon "CustomCommands":
<?xml version="1.0" encoding="utf-8"?>
<GMRibbonCustomUI xsi:schemaLocation="http://www.intergraph.com/GeoMedia/RibbonCustomUI gmribboncustomui.xsd" rcVersion="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intergraph.com/GeoMedia/RibbonCustomUI">
<tab name="CustomCommands" visible="0"></tab>
This (start gws and deactivate ribbon) should be done by running the batch file but it only starts the gws. Nothing happens with the ribbons, the customized settings are not being applied.
This program worked until GM6.1 or even GM2013. When loading the CustomCommands.xml via GUI Customize Ribbon > Import the settings are being imported correctly.
Thats why we think that maybe the LoadCustomizedSettings command described above is no longer available on GM 2014 and higher and/or that maybe customized Ribbon tabs can't be integrated in Geomedia via API anymore, only via GUI.
Maybe anyone has tried this in Geomedia 2014 or higher?
07-11-2017 05:25 AM
You will find the help topics for these methods in the GeoMedia Object Reference (on the Start menu) rather than in the command wizard help. But what you will also see there is that these methods are specific to the menu/toolbar system that existed in GeoMedia 2013 and previous. Beginning with GeoMedia 2014, only the ribbon bar is available in the GeoMedia framework, and its customization practices are completely different from the prior "customized settings" system. You need information about customizing the ribbon bar, and that material is definitely available online. One source is: http://community.hexagongeospatial.com/t5/Shared-Samples/Adding-Ribbon-Commands-to-GeoMedia/ta-p/653, but there may be others as well. - Hal
07-11-2017 06:36 AM - edited 07-11-2017 06:39 AM
I'm the awkward customer. ;-)
I would like to have an API for the functionality in the ribbon context menu (customize ribbon etc.). At least a load and save function for ribbon configuration files (like the old Load-/SaveCustomizedSetting method). The GeoMedia API concept was everything is open in the API. Why ribbons break with this tradition?
The solution with the the VC++ library for own ribbons is a good solution for full addon packages but is not a solution for smaler dynamic ribbon modifications while the application is running. For small modification it's an overkill.
In addition the xml files like described under the links supplied by psmith has problems with custom commands. The xml file contains for custom commands their command ids (41000+...). This command id aren't stable between different machines! So I can't release ribbon custom settings for the user profiles with GMRibbonCustomUI.xml.
The xml file should use the ProgID like in the custom command xml configuration file. The command id is useless.