« IFC GUID Algorithm Update and Family Modification | Main | Autodesk View and Data API »

July 03, 2014

Comments

Wow this is interesting. Over the years I have had many requests by people if we could disable the explode command. Now I'm assuming we could remove that button altogether from the ribbon? I wonder how this works on contextual panels???

Dear Phillip,

Power to the people, or at least to you.

Cheers, Jeremy.

Yes you can indeed remove the explode buttons (I tried it out) and they stay removed for the remainder of the Revit session. The trick is to catch them while they are showing, I did it by selecting an imported cad file to bring up the context panel and then ran an external command that searches for the buttons and removes them, it's a manual process though.

For automation I think it would be possible to place the seek and remove code into an IExternalCommandAvailability class associated with an API button that has been added to the modify tab. It would then get triggered automatically along with the display of the contextual panel. The button could then even remove itself once it has done its job (the perfect crime).

There's probably a race condition though, as the explode buttons might not always be added before the availability checker is triggered, but its worth a try.

Dear Jeremy

I have a question in another issue and i need your advise :)
How to tag element in a linked project ?
I use the this method to tag a linked pipe element but it throw an error please advise thanks :)

LocationCurve loc = pipe.Location as LocationCurve;
XYZ startp = loc.Curve.GetEndPoint(0);
XYZ endp = loc.Curve.GetEndPoint(1);
XYZ midp = loc.Curve.Evaluate(0.5, true);
newtag = DOC.Create.NewTag(view, pipe, false, tagmode, tagorian, midp);

I've got some code working based on this article. The code loops through an xml file and sets ribbonItem.IsVisible per button in my addin. This works for all of my buttons except for a PullDownButton. The buttons that are added to the PullDownButton aren't included as items in RibbonPanel.Source.Items. Any idea how to get the buttons in the PullDownButton that is found in there?

Thanks

@ TroyGates. If the button is PullDownButton you should be able to cast it to a PullDownButton. Then use the GetItems() method to get an IList that you can then iterate through to set the visibility. I've implemented this in an addin before.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource