How to enable buttons in Group Edit mode

lionel.kai
Advisor

How to enable buttons in Group Edit mode

lionel.kai
Advisor
Advisor

I have a bunch of buttons in our Ribbon tabs - most are just to insert Detail Components & Annotations Symbols using PostRequestForElementTypePlacement, and some are links to web pages (for HOWTOs and documentation). I've enabled the buttons for zero doc state (by implementing IExternalCommandAvailability). However, ALL of the buttons get disabled in Group Edit mode.

 

How do I get around that?

 

It wouldn't make sense to have to exit Group Edit mode to insert the AS/DC, and have to Cut and Paste it back into Group Edit mode...


Lionel J. Camara
BIM Manager at KAI Hawaii, Inc. - Structural and Forensic Engineers
Autodesk Certified Professional
Reply
574 Views
6 Replies
Replies (6)

RPTHOMAS108
Mentor
Mentor

I have a strong suspicion that it isn't possible.

 

I think it is similar to other editing modes in that they complete their own transactions. So you can't interact with Revit during that time.

 

Groups functionality is a bit limited with the API. Likely the best you can do is record the ids in the group, ungroup them, add the extra item and regroup them (easier to do this without the UI API methods such as prompt for family placement however). You can prompt for placement and then add to group but you would have to do that by getting a valid API context after the UI method has finished and getting the added id.

0 Likes

lionel.kai
Advisor
Advisor

@RPTHOMAS108 Yeah, thanks for the suggestion, but not sure how I'd do that... would have to somehow hijack/block the Edit Group command, then fake the UI so that the user thinks they're in Group Edit mode (a very daunting prospect), then after the user presses a button do the editing behind the scenes... and have to deal with whatever else they may want to do - modifying elements & even canceling the edit... I created a support ticket [Case number20010953] to verify that it's a "no", but suspect I'll wind up having to create an Idea...


Lionel J. Camara
BIM Manager at KAI Hawaii, Inc. - Structural and Forensic Engineers
Autodesk Certified Professional

caroline.gitonga
Autodesk
Autodesk

Hi @lionel.kai,

Unfortunately, Revit does not allow execution of any external code which includes external commands too when in edit mode.Not only on group edit mode but in almost all edit modes. In this case all your other buttons will stay disabled until the edit mode completes.

And sorry to say your workaround "It wouldn't make sense to have to exit Group Edit mode to insert the AS/DC, and have to Cut and Paste it back into Group Edit mode..." is is the only way to achieve this at the moment. You have to ungroup a group before being able to modify elements in it just as @RPTHOMAS108  has adviced above.

You may refer to this resource material on Group editing mode:https://thebuildingcoder.typepad.com/blog/2010/08/editing-elements-inside-groups.html to see a thread of similar cases were handled

Carol Gitonga, Developer Advocacy and Support, ADN Open

ricaun
Advisor
Advisor

This week I discovered my plugin that uses IUpdater does not work well with Groups.

 

The IUpdater triggers normally when you are editing the Group that's good. And If I copy the finished group and the IUpdater trigger my updater tries to change an element inside a group and Revit does not like that, showing some warning and stuff. Ignore that warning should 'Fix' my issue.

 

Maybe IExternalEventHandler could trigger inside an edited Group. And if it is possible technically you can run any code with the Edit Group opened.

 

Edited: I tested and IExternalEventHandler does not work, Idling does not trigger and Macro is disabled as well.

 

 

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

DanielKP2Z9V
Advocate
Advocate

Is anyone aware of any plans to remove this limitation?

0 Likes

lionel.kai
Advisor
Advisor

Please vote for the idea here:

 

enable External (API) Commands in (Group) Edit Mode - Autodesk Community


Lionel J. Camara
BIM Manager at KAI Hawaii, Inc. - Structural and Forensic Engineers
Autodesk Certified Professional
0 Likes