Ignore/forget the ribbon... it requires at least another 'pick' or more to get to the command you want... just another example of Autodesk's unfortunate (there are other words) alliance with M$... I'm leaning more and more to Bricscad
I know that everyone has different hardware configurations (
i.e. computer specs, monitor sizes, etc.), but I've never had an issue with the Ribbon... Except back in LDC 2009, which was not customizable to the user (
until a service pack, etc.).
In any event, one could easily create a keyboard alias for this .NET CommandMethod, or add to a one-click mouse macro, etc. so you don't need to move your mouse up, down, or to the side, for the ribbon... You could even add a LispFunction if needed.
This code iterates the RibbonTabCollection to check... checks for the defined RibbonTab, and if it exists, sets it active. If the RibbonTab is not found, then the RibbonTab is created and set active.
Pseudo code:
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.Windows;
using System;
// This line is not mandatory, but improves loading performances
[assembly
: CommandClass
(typeof(FOO
.MyCommands))]
namespace FOO
{
public class MyCommands
{
private Editor ed =
Application.DocumentManager.MdiActiveDocument.Editor;
// Jeff_M is awesome:
// http://www.theswamp.org/index.php?topic=32869.msg383525#msg383525
[CommandMethod("DOCRIB")]
public void DOCRIBCMD()
{
// Define ribbon properties
String myTabId = "DOCTAB";
String myTabTitle = "Document";
Boolean myTabIsContextual = true;
try
{
RibbonControl oRibbon = ComponentManager.Ribbon;
if (oRibbon != null)
{
RibbonTab oTab = oRibbon.FindTab(myTabId);
if (oTab != null)
{
oTab.IsActive = true;
}
else
{
oTab.Title = myTabTitle;
oTab.Id = myTabId;
oTab.IsContextualTab = myTabIsContextual;
oTab.IsVisible = true;
oRibbon.Tabs.Add(oTab);
oTab.IsActive = true;
// <-- Add your ribbon panel(s) here
}
}
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
ed.WriteMessage("\n** Error: " + ex.Message + " ** ");
}
}
}
}
Renderman - for what its worth, I've been able to whatever I wanted/needed to do for over 25 years in plain Alisp/DCL. And, be assured that my programs work in pretty much any variety of Intellicad, especially Briccscad. Does anyone really care about ACAD anymore?
I suggested DOSLib, as it may help someone who does not know how to code DCL, nothing more.