- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I Will autoload a .NET assembly in autocad 2013, I have try it with the .XML file but it doesn`t works. I Will that when the autocad Starts load an custom ribbon tab that I develop. If I load the .dll with the NETLOAD function it works and appear the ribbontab. The content of the XML file is the following:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD" Name="Crear" Description="Genera nombre acorde con la númeracion de Vault" AppVersion="1.0.0" ProductType="Application" AppNameSpace="AutoCADRibbon">
<CompanyDetails Name="Test" />
<Components>
<RuntimeRequirements OS="Win64|Win32" Platform="AutoCAD*" SeriesMin="R19.0" SeriesMax="R19.0" />
<ComponentEntry AppName="AutoCADRibbon" ModuleName=".\Contents\AutoCADRibbon.dll">
<Commands GroupName="Crear">
<Command Local="Crear" Global="Crear" StartupCommand="True" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>
And the .NET Code is:
[
CommandMethod("Crear", CommandFlags.Transparent)]
publicvoid Testme()
{
RibbonControl ribbon = ComponentManager.Ribbon;
if (ribbon != null)
{
RibbonTab rtab = ribbon.FindTab("Crear Nombre");
if (rtab != null)
{
ribbon.Tabs.Remove(rtab);
}
rtab =
newRibbonTab();
rtab.Title =
"Crear Nombre";
rtab.Id =
"Nombre";
ribbon.Tabs.Add(rtab);
addContent(rtab);
}
}
publicvoid addContent(RibbonTab rtab)
{
rtab.Panels.Add(AddOnePanel());
}
publicRibbonPanel AddOnePanel()
{
RibbonButton rb;
RibbonPanelSource rps = newRibbonPanelSource();
rps.Title =
"Nombre documento";
RibbonPanel rp = newRibbonPanel();
rp.Source = rps;
RibbonButton rci = newRibbonButton();
rci.Name =
"TestCommand";
rb =
newRibbonButton();
rb.ShowImage =
true;
rb.LargeImage =
newBitmapImage(newUri(@"C:\Program Files\Autodesk\ApplicationPlugins\GeneradorNombresVault\Contents\bt32.PNG"));
rb.Orientation = System.Windows.Controls.
Orientation.Vertical;
rb.Size =
RibbonItemSize.Large;
rb.Name =
"btNombre";
rb.ShowText =
true;
rb.MouseLeft += (sender, e) =>
{
};
rb.Text =
"Crear Nombre..."; //Add the Button to the Tab
rps.Items.Add(rb);
return rp;
}
Some help?
Thank you very much!
Solved! Go to Solution.