TheSwamp

Code Red => .NET => Topic started by: shers on August 26, 2015, 05:57:39 AM

Title: ribbon in bundle
Post by: shers on August 26, 2015, 05:57:39 AM
Hi,

I have created a ribbon with a tab with code and has two buttons in it. When my command is typed, after netload, the ribbon is displayed. Then I use the click event to display the corresponding windows for the buttons. Now I want to build this, so that when the user installs it, it should be added as the same way as I debug. How can I accomplish this?

Thanks
Title: Re: ribbon in bundle
Post by: MexicanCustard on August 26, 2015, 08:02:35 AM

Now I want to build this, so that when the user installs it, it should be added as the same way as I debug. How can I accomplish this?


Are you asking how to create an Autoloader Bundle? Autoloader (http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html)

Are you asking how to make the Ribbon appear automatically after loading? IExtensionApplication (http://through-the-interface.typepad.com/through_the_interface/2006/09/initialization_.html)

The Ribbon can also be loaded via a "cuix" file and a Bundle.  This method will create and display the Ribbon Tab at startup.
Title: Re: ribbon in bundle
Post by: BlackBox on August 26, 2015, 12:58:11 PM
If implementing code-based Ribbon components using IExtensionApplication and implicitly LoadOnAutoCADStartup="true" within your Autoloader .bundle's PackageContents.xml, then be sure to implement an Application.Idle event handler, etc. in order to ensure that the Ribbon UI has been initialized prior to attempting to add to same.

[Edit] - If distributing to others, I prefer to provide .CUIx so users can incorporate into their own Workspace as they see fit, YMMV.
Title: Re: ribbon in bundle
Post by: dgorsman on August 26, 2015, 02:51:38 PM
[Edit] - If distributing to others, I prefer to provide .CUIx so users can incorporate into their own Workspace as they see fit, YMMV.

Which is greatly appreciated.  Dynamically generated ribbon tabs/panels are a PITA to manage with user-specific workspaces.
Title: Re: ribbon in bundle
Post by: BlackBox on August 26, 2015, 03:14:09 PM
[Edit] - If distributing to others, I prefer to provide .CUIx so users can incorporate into their own Workspace as they see fit, YMMV.

Which is greatly appreciated.  Dynamically generated ribbon tabs/panels are a PITA to manage with user-specific workspaces.

All I can say, is that I'm a civil designer first, and a developer second, which is why I strive to provide others what makes the most sense to me as a CAD user.

All of my AX app .CUIx components call Commands, be they LISP Defun, or .NET CommandMethod, so that they are accessible from both Command Line, or UI....


[rant]
... Unlike the myriad native MenuItem.Click calls to the underlying Method() which define a given CommandMethod, without Locking the Document, so I can not catch DocumentLockModeChanged event, and Veto(). Civil 3D's Toolspace CREATEDATASHORTCUTS context menu item is a prime example. Grrr
[/rant]


I happen to think that the requirement to provide .CUIx in order to have one's app published at AX is a general waste of time, especially given how .CUIx / .MNR files remain after successful uninstallation of even a formal AX App; but that's just this man's opinion. Haha

Cheers