On double click of an entity I wish to show its details on a custom form. Can you show me how to do this ?
Doing this involves two steps :
1) Creating a double click action which invokes a command to display the custom form.
2) Retrieving the selected entity that was double-clicked using the Implied selection.
Here is the sample code to create a double-click action that invokes the custom command :
// Add reference to AcCui.dll
public void RegisterDoubleClickActionMethod()
= (string)Application.GetSystemVariable("MENUNAME") + ".cuix";
CustomizationSection cs = new CustomizationSection(mainCuiFile);
int index = 0;
DoubleClickAction circleDoubleClickAction = null;
foreach (DoubleClickAction dca in cs.MenuGroup.DoubleClickActions)
if (dca.Name.Equals("My Double click"))
index = 0;
MacroGroup myMacroGroup = null;
foreach (MacroGroup mg in cs.MenuGroup.MacroGroups)
if (circleDoubleClickAction == null && myMacroGroup == null)
= new DoubleClickAction(cs.MenuGroup, "My Double click", -1);
dblClickAction.Description = "Double Click Customization";
dblClickAction.ElementID = "EID_mydblclick";
dblClickAction.DxfName = "Circle";
DoubleClickCmd dblClickCmd = new DoubleClickCmd(dblClickAction);
= new MacroGroup("myMacroGroup", cs.MenuGroup);
"My Form help",
"Test MyForm label"
dblClickCmd.MacroID = macroMyForm.ElementID;
dblClickAction.DoubleClickCmd = dblClickCmd;