.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD 2015 Autoloader loading dll timing issue

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
gotMorris
1052 Views, 7 Replies

AutoCAD 2015 Autoloader loading dll timing issue

We have upgraded to AutoCAD 2015 and are having problems with custom plugins. I already have addded LoadOnAutoCADStartup="True" to my autoLoader. My plugins dll seems to load at different times for each start up of autoCAD. What is happening is sometimes a deafult autoCAD command will load instead of my plugins command at start up. This seems to happen randomly. The name of my plug in is batch. Sometimes BATCHPLOT will load and display its dialog box. After I cancel that dialog box my plugin will load but my palette will not display eventhough it was open before I closed autoCAD. This was never a problem in autoCAD 2013.I have attached a short video of me opening auotCAD closing reopening autoCAD and getting different results. One of the main complaints I am getting is that the palette isn't displaying when they reopen autoCAD. I don't know if these problems are related.Any help would be appreciated.

 

 

---below is a portion of my PackageContents.xml---

 

<Components>
<ComponentEntry LoadOnAutoCADStartup="True" AppName="Batch" ModuleName="./Contents/Resources/Drafting/Plugin/bin/Release/Plugin.dll" />
</Components>

7 REPLIES 7
Message 2 of 8
norman.yuan
in reply to: gotMorris

The fact that sometimes AutoCAD opens "BatchPlot" dialog box, sometimes not and when it does, your PaletteSet would not open properly afterward is because of the previous AutoCAD was closed while your PaletteSet was open. I'd bet if AutoCAD is closed without your PaletteSet open, then you would not have this issue the next time when AutoCAD starts.

 

The reasons are:

 

1. Autodesk added a new built-in command "BatchPlot", which is the same as "Publish" since AutoCad2014. "BatchPlot" command also has an alias "Batch", which is the same as your PaletteSet's name you set in the PaletteSet's constructor.

 

2. PaletteSet has a few constructors, for the ones that take a single string value as "Name", the "Name" argement is actually a command name that is impliciltly by the PaletteSet contructor as an command to open the PaletteSet. This PaletteSet feature of "name" being used as command is not clearly documented and has been mentioned in various discussion groups.

 

3. When AutoCAD starts, if in previsous session a PaletteSet was left open, AutoCAD will try to open it automatically by using the command registered by the PaletteSet's constructor.

 

As you can see, your PaletteSet unfortunately uses an AutoCAD builtin command (only avaialable since AutoCAD 2014) "BATCH", thus the problem you are facing (but not in AutoCAD2013 or earlier).

 

One way to avoid this is to pass a different name into the Paletteset's constructor, so that name is not the same as any existing command/command alias. Better yet, do not give the PaletteSet's constructor a name parameter, or use the PaletteSet's constructor that takes 3 parameters:

 

PaletteSet (string name, string cmd, Guid id)

 

In this case, you can pass null/empty string to the "cmd" argument

Message 3 of 8
gotMorris
in reply to: norman.yuan

Thanks Norman for your detailed response. The option I choose was to just rename the command. This prevented the built-in Batch command from opening however my palette would not display on start up if it was displayed before closing. It would remember its placement on the screen after I opened it manually. I was able to get around this by adding the command to my acad.lsp file so it will display everytime I open autoCAD. This is not ideal but is better than not displaying. Do you have any ideas why this would not rember its state of being displayed or hidden but would rember it position on the screen?

Message 4 of 8
Keith.Brown
in reply to: gotMorris

I could be entirely wrong here but I do not believe that custom palettes will remember their state when AutoCAD shuts down and starts up.  That is something that you will need to do programmatically.  I use the windows user settings to save configuration settings between sessions and then in my startup procedure just check the state of  a show palette variable to determine if the palette should be shown or not.

Message 5 of 8
gotMorris
in reply to: Keith.Brown

Keth,

I thought it remembered its state automatically before the upgrade but I may be wrong also. I will load the old version Monday and test it. Thanks.

Message 6 of 8

Hi,

 

Also, try adding AppDescription field in packagecontent.xml as shown below. Though app loading is kind of independent from the description field, we have seen some times, AutoCAD 2015 fails to load the dll on startup when the description is missing in component entry  

<ComponentEntry LoadOnAutoCADStartup="True" AppDescription="This is Batch plot tool" AppName="Batch" ModuleName="./Contents/Resources/Drafting/Plugin/bin/Release/Plugin.dll" />



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Message 7 of 8

Adding the AppDescription tag solved my problem. Thanks for everyone's help.
Message 8 of 8

Thank you!!!! This fixed my packagecontents.xml file!!!  2 days of searching


@Virupaksha_aithal wrote:

Hi,

 

Also, try adding AppDescription field in packagecontent.xml as shown below. Though app loading is kind of independent from the description field, we have seen some times, AutoCAD 2015 fails to load the dll on startup when the description is missing in component entry  

<ComponentEntry LoadOnAutoCADStartup="True" AppDescription="This is Batch plot tool" AppName="Batch" ModuleName="./Contents/Resources/Drafting/Plugin/bin/Release/Plugin.dll" />


 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost