AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autoloader : issue with .NET module

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
yves.chane-kaneC8DTQ
1260 Views, 2 Replies

Autoloader : issue with .NET module

yves.chane-kaneC8DTQ
Explorer
Explorer

Hi,

 

I would like to use Autoloader (.bundle) to load my dll when Autocad Map 3D 2021 starts, but I have an issue.

My module adds elements to the main ribbon but it seems that the dll is loaded before the ribbon is initialized, so it does not work.

Is there a solution to configure Autoloader to load my dll after the Autocad UI initialization ?

When I use NETLOAD, everything is ok.

 

Thanks !

0 Likes

Autoloader : issue with .NET module

Hi,

 

I would like to use Autoloader (.bundle) to load my dll when Autocad Map 3D 2021 starts, but I have an issue.

My module adds elements to the main ribbon but it seems that the dll is loaded before the ribbon is initialized, so it does not work.

Is there a solution to configure Autoloader to load my dll after the Autocad UI initialization ?

When I use NETLOAD, everything is ok.

 

Thanks !

2 REPLIES 2
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

It is not very clear to me: what do you mean "My module adds elements to the main ribbon...".

 

If I have to guess, I assume that your code runs after loaded via IExtensionApplication.Initialize(), and in the Initialize() your code update the existing/main ribbon. If that is what your code does, then, you SHOULD NOT assume certain ribbon item (Tab, or Panel, or button...) is available for your code to manipulation; it is also possible the Ribbon control itself may not available when your code is loaded (it is very likely what you have experienced).

 

If your code is to  update the ribbon menu when loaded, you do not let the code to reach the ribbon right away. Instead, you set up Application.Idle event handler, meaning, after your code loaded, it will wait until AutoCAD finishes its startup actions (depending on the versions of verticals, how many plugins to be loaded at beginning, it would take short or long time). Then in the Idle event handler, you still need to test if the Ribbon control is available or not (some user may be "very-smart" to disable the ribbon!) and only go ahead with your ribbon manipulating code when the ribbon control is available. 

 

HTH

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

It is not very clear to me: what do you mean "My module adds elements to the main ribbon...".

 

If I have to guess, I assume that your code runs after loaded via IExtensionApplication.Initialize(), and in the Initialize() your code update the existing/main ribbon. If that is what your code does, then, you SHOULD NOT assume certain ribbon item (Tab, or Panel, or button...) is available for your code to manipulation; it is also possible the Ribbon control itself may not available when your code is loaded (it is very likely what you have experienced).

 

If your code is to  update the ribbon menu when loaded, you do not let the code to reach the ribbon right away. Instead, you set up Application.Idle event handler, meaning, after your code loaded, it will wait until AutoCAD finishes its startup actions (depending on the versions of verticals, how many plugins to be loaded at beginning, it would take short or long time). Then in the Idle event handler, you still need to test if the Ribbon control is available or not (some user may be "very-smart" to disable the ribbon!) and only go ahead with your ribbon manipulating code when the ribbon control is available. 

 

HTH

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3

yves.chane-kaneC8DTQ
Explorer
Explorer

I didn't know this Application idle event.

Now, handling this event, all works fine.

 

Thank you

0 Likes

I didn't know this Application idle event.

Now, handling this event, all works fine.

 

Thank you

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report