.NET

.NET

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

start addin that add a ribbon when AUTOCAD start

1566 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

ADN Support Specialist
StephenPreston
Posts: 429
Registered: ‎05-22-2006
Message 2 of 4 (1,539 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,528 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

ADN Support Specialist
StephenPreston
Posts: 429
Registered: ‎05-22-2006
Message 4 of 4 (1,509 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.