

using the ContextMenuExtension class or its ObjectARX equivalent). Hopefully it’s as simple as adding a “Shortcut menu” with the OBJECT_TABLE alias, rather than our current approach of adding the item to the “Edit Menu” which applies to all objects.Īs you can see for the per-Table menu items that do get displayed in the context menu, it’s quite likely that these were added via the non-CUI mechanism (i.e. The main CUI file contains a number of “per-object type” menu sections, but there isn’t one for Tables. Our TABLEEXPORT2 command only works on Table objects, but I haven’t yet found a simple way in CUI to restrict the existence of menu items to a specific object type. I designed a custom icon – which you can get here and place in the same folder as your compiled DLL – but you might also change the “tableexp.bmp” references in the code to “RCDATA_16_TABLE” (which will cause the TABLE command’s icon to be used). I adjusted Parrish’s code to add a right-click menu item to call the command we saw in the last post. (the reload is particularly expensive) Only save and reload the CUI if we added our menu New PopMenuItem (mac, "Unicode Export.", menu, pos + 1) (test != null & test.Name != "Unicode Export." ) Var test = menu.PopMenuItems as PopMenuItem only if it isn't already where we expect it to be Add a separator and then the new menu item, but If (item != null & item.MacroID = "ID_AddSelected" ) Var item = menu.PopMenuItems as PopMenuItem we'll insert our menu in front of that If we find the "Add Selected" item, then Default position is the last in the listįor ( int i=0 i < i++) Ignore all except the "Edit" context menu not to be added back in as duplicate when weįoreach ( PopMenu menu in )

(otherwise we need to get it from the group for it "Exports a table to a Unicode-compatible CSV" , Grp = new MacroGroup (cuiSectionName, acMenuGroup) Grp = acMenuGroup.FindMacroGroup(cuiSectionName) GetSystemVariable( "MENUNAME" ) + ".cuix" Using Ĭonst string cuiSectionName = "TTIF_Menus" Īpplication.
