Override Double Click Group

Override Double Click Group

Anonymous
Not applicable
1,130 Views
3 Replies
Message 1 of 4

Override Double Click Group

Anonymous
Not applicable

I would like to know if there is any way that I could override the double click action for Groups so that instead of editing the group, a custom modal dialog opens.

 

I tried using a ViewActivating event, but bringing up the Group Editor does not seem to trigger it for some reason.

 

The event should also have knowledge of which Group was double clicked on.

0 Likes
Accepted solutions (1)
1,131 Views
3 Replies
Replies (3)
Message 2 of 4

Revitalizer
Advisor
Advisor
Accepted solution

Hi drdanielfc,

 

even if you would intercept the doubleclick event, you wouldn't prevent Revit from opening the group edit mode.

Also, if you want to prevent users from modifying groups completely, you would have to intercept clicking just the "Edit Group" button.

Additionally, there could be a keyboard shortcut assigned to this function.

 

There may be another way to do so:

In the SDK, there is a DisableCommand project:

http://thebuildingcoder.typepad.com/blog/2012/06/replacing-built-in-commands-and-their-ids.html

 

I don't know if the edit group command is a replacable one, just try it out.

The relating command id string may be found in Revit journal file, after invoking it at least one time manually.

 

But take in account that replacing existing functions may cause problems since Revit will not any longer behave as users expect.

If you prevent users from editing groups at all, you may cause them to call to Autodesk support since it may not be visible clear that the trouble is caused by your own add-in, especially if there are several ones installed.

 

 

Revitalizer

 

 




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 3 of 4

Anonymous
Not applicable

Unfortunately, it seems like the Edit Group button never raises an overridable event. Only the Finish and Cancel (ex ID_FINISH_GROUP_EDIT_MODE) buttons are overridable, which would be acceptable for my purposes if they were selectively overridable. Unfortunately, as soon as I override CanExecute, it greys out the button even if I set CanExecute to true. BeforeExecuted does not allow me to cancel the event, and Executed forces me to override the event even if I want to go thru with it.

 

So looks like this interface won'[t work for me. I'll have to use something like this instead.

0 Likes
Message 4 of 4

Revitalizer
Advisor
Advisor

Hi,

 

so what about disabling the original "Edit Group" button and replacing it by your own one ?

 

This is the idea:

Get the AdWindows.dll ribbon button representing the original "Edit Group" function (see TBC and "Pimp my Revit" for further information).

Replace its command binding with a dummy binding which is always disabled.

 

Disable also the command behaviour so that even the command keyboard shortcuts won't invoke it.

 

After this, original Edit Group should be locked in all ways.

 

Now provide your own "Edit Group" button which just executes a PostableCommand using a RevitCommandId etc.

 

You need to re-enable default "Edit Group" behaviour before executing PostableCommand and disable it after it.

This way, you should have control over "Edit Group" function in each case.

 

It's just an idea, I didn't try this out on myself.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes