.NET

.NET

Reply
Contributor
gots
Posts: 12
Registered: ‎08-23-2010
Message 1 of 4 (1,487 Views)

start addin that add a ribbon when AUTOCAD start

1487 Views, 3 Replies
04-18-2012 09:09 AM

Hi

 

I'm sure this kind of subject was already discussed, but I haven't find any working solution of my problem.

I have a VB .NET Dll that add a new ribbon in AUTOCAD.

When I load this dll from AUTOCAD, this new ribbun is well added.

I'm trying to start this dll with AUTOCAD Start.

I have tried the solution explaned from this Kean Walmsley page but no succes.

I've tried to load the DLL from the acad.lsp but the DLL is loaded before AUTOCAD load the ribbon, then the dll is well loaded but my new ribbon is not displayed !.

 

Do you have any way to do what I'm trying to do ?

thanks

Board Manager
StephenPreston
Posts: 377
Registered: ‎05-22-2006
Message 2 of 4 (1,460 Views)

Re: start addin that add a ribbon when AUTOCAD start

04-19-2012 10:03 AM in reply to: gots

Hi gots,

 

As explaiend in the ObjectARX Application Interoperability Guidelines (part of the ObjectARX SDK helpfiles), it is very bad practice to set your plug-in to load on AutoCAD startup unless you have a really compelling reason for doing so. The reason is obvious if you consider a user who has several plug-ins registered to load on startup - they significantly slow down AutoCAD startup.

 

If you're using AutoCAD 2012 or 2013, then I recommend you make use of the Autoloader feature, to automatically load a partial CUIX on startup and set your .NET plug-in to load on command invocation. There's some good info posted here about Autoloader - http://through-the-interface.typepad.com/through_the_interface/2011/09/autodesk-exchange-preparing-y....

 

If you're using AutoCAD 2013, and you really have to load your plug-in on startup (and have your plug-in programmatically create ribbon elements, then you can use the new Autoloader StartupCommand parameter. The XML for that would look something like this:

 

<Components>

  <ComponentEntry ModuleName="./Contents/blah.dll">

     <Commands>

        <Command  LocalCmd="RunMeCmd" GlobalCmd="RunMeCmd" StartupCommand="True" />

     </Commands>

  </ComponentEntry>

</Components>

 

 

Cheers,

Stephen Preston
Autodesk Developer Network
Contributor
gots
Posts: 12
Registered: ‎08-23-2010
Message 3 of 4 (1,449 Views)

Re: start addin that add a ribbon when AUTOCAD start

04-19-2012 11:59 AM in reply to: StephenPreston

hi

 

thanks for your answer.

We developped our plugin few years ago in VBA. we loaded the plugin with acad.lsp and create our own menu in the menu bar.

I have read that vba will be no longer supported with 2014 autocad release, then we start to convert our plugin in VB .NET and decide to create a ribbon instead of our menu.

As our customer are used to see our plugin at Autocad statrup, we want to keep this behaviour with the ribbon.

So, If I understand, there is no solution with Autcad 2010 and 2011 ?

the only way is to keep our menu or use a menu to add the ribbon by a manual action ?

 

Thanks

Gots

Board Manager
StephenPreston
Posts: 377
Registered: ‎05-22-2006
Message 4 of 4 (1,430 Views)

Re: start addin that add a ribbon when AUTOCAD start

04-20-2012 04:55 PM in reply to: gots

I recommend Autoloader for AutoCAD 2012 upwards. For earleir versions - by adding code inside your plug-in - this discussion thread should give you what you need - http://forums.autodesk.com/t5/NET/ads-queueexp/td-p/3423087. Define the code you want to run as a command, and then queue it up.

 

Cheers,

Stephen Preston
Autodesk Developer Network
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.