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

AutoCad 2015: autoLoader loading dll but commands not working

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
mhama
6855 Views, 18 Replies

AutoCad 2015: autoLoader loading dll but commands not working

This is my first tinker with the autoloader since it came out. I have just upgraded to AutoCAD Map 2015 from 2012. As it is my first time I read the white paper "AutoCAD Plugin AutoLoader" and other posts out there to understand what is going on. After a couple of tries I finally had my vb.net loaded, but I can not seem to get my commands recognised. I have upgraded the programs with VS express 2013and put in the new accoremgd reference and everything is working as long as I netload the .dlls. I have checked http://forums.autodesk.com/t5/NET/AutoCAD-2015-Autoloader-Changes/td-p/4910140

and http://forums.autodesk.com/t5/NET/AutoCad-2015-autoLoader-not-loading-dll/td-p/4943902 and still not nothing.As i am not very well versed with XML, I am maybe making some error that i can not find,  I have attached my packagecontents file.

18 REPLIES 18
Message 2 of 19
dimitri
in reply to: mhama

I have the same problem here, NETLOAD is apparently loading my DLL when initializing AutoCAD Mechanical 2015 but I cannot get tha ribbons and commands available. It was fine until version 2014.

Please I do not understand anything of XML, I just want to keep loading my .NET or DLL file by using NETLOAD command as always. Thanks

Message 3 of 19
mcicognani
in reply to: mhama

I've checked the .xml and it seems correct. You may need additional parameters before uploading the bundle on the Exchange Store, but I don't think it would make a difference now.

It strikes me however, that you have a single DLL for all that versions of AutoCAD, shouldn't you need to recompile it when AutoCAD breaks binary compatibility? (I not versed in VB, just C#, so I may be wrong here)

 

My suggestion is to start adding secondary parameters that right now seems irrelevant, but that may interfeer with the correct loading, like SupportedLocales="Enu", AppNameSpace and/or UpgradeCode. At the beginning I remember some parameters were marked as optional, but I needed to add them anyway to make it work. I haven't checked the Autodesk guide recently, I just continued to modify the first xml that worked 😉

 

I attach a xml that work for sure, it still misses the 2015 section, but you can guess it from the other sections.

Message 4 of 19
mhama
in reply to: mcicognani

Thanks for the reply, appreciate it. I was trying to go as vanilla as possible just to start so that if something did not work i could easily diagnose. I put all the details in and still the commands are not being recognized. I use APPAUTOLOADER to list the apps loaded and my app is definitely loaded. so still not sure what I am doing wrong. Is there code that i can use to test which parts on my modules are loaded? or see which part is not being loaded?

Message 5 of 19
dimitri
in reply to: mhama

ok, I built my own XML and made it run on ACADM2014, it was ok. When I try ACADM2015 it really does not work. It runs the XML but also does not recognize the commands available in the DLL.

Message 6 of 19
mcicognani
in reply to: mhama

Why don't you debug your DLLs using Visual Studio? You can place a break point in the initialization code of your classes and see what happen...

Anyway, in my experience, if something goes wrong the DLL would be stopped dead, no part would be working. Still, in that state, it cannot be unloaded or reloaded if not restarting AutoCAD (as every other DLL, working or not).

 

However, you say your command are not launched, but: are listed in the command prompt while you digit the command or it simply say that are non recognized?

If you see the command while you digit, you may be sure that the declaration inside your plugin is correct (and the dll is running), if not you have two chances:

- during initialization of the dll something goes wrong and it stops (debug debug debug)

- maybe you dropped some declaration in your code. Have you tried a vanilla plugin with all the declaration in place crated by the wizard?

Message 7 of 19
mhama
in reply to: mcicognani

I was just debugged  and it works perfectly fine, the code runs all the way through, no problem.

 

Yes, when I type the command it autolists in the command prompt and i can select it. it just does not run. I can even netload it and it works perfectly fine.

 

I will do a test with a vanilla plugin and see.

Message 8 of 19
mcicognani
in reply to: dimitri

Dimitri,

is the ribbon loaded on 2015? This should be all work of the autoloader and the xml. It's independent of the dll itself. Check the version Min = 20.0, Max = 20.0, and eventually try to load the cuix manually on 2015, just to be sure the cuix file is good.

 

For the DLL, could it be a stupid thing you overlooked? check the reference to ObjectArx2015, build against 4.5.1 framework, ...

Message 9 of 19
mhama
in reply to: mcicognani

No checked that too and it is built on 4.5.1 and using the 2015 libraries. It is interesting that i can netload and it works perfectly fine and it will not wih the AutoLoader. I will start with a simple .dll and check

 

Message 10 of 19
mcicognani
in reply to: mhama

was for Dimitri, but I guess it's a good advice for everyone... 😉

mhama, double check the xml, I spent hours on one of them just for a stupid slash missing. If it's demand loading, you may still see the commands because they're read on startup, but AutoCAD may fail finding the DLL or loading it when you run the actual command...
Message 11 of 19
mhama
in reply to: mcicognani

Okay will do that too. This is supposed to be easier but more intuitive but with little XML knowledge can be a huge problem. I will double check everything

Message 12 of 19
dimitri
in reply to: mcicognani

many thanks mcicognani,

 

My DLL was built with the old framework 4.0 and ObjectArx2014!!! lol

 

The ribbon wasn't loaded using autoloader, neither the new DLL. Then I decided to keep my old lisp routine that uses NETLOAD. It is ok, now it is just the time to debug the application to solve some issues generated by the new autocad API files. 

 

One important point is that I needed to install a later version of Visual Studio Express (only 2012 or 2013 versions are compatible with the framework 4.0, but only 2012 will run in Windows seven - with known issues...).

Message 13 of 19
mhama
in reply to: mhama

 I tried the vanilla program and it worked fine. I used exactly the same xml with the names changed.

 

I changed the command statement in my project from:

 

<Autodesk.AutoCAD.Runtime.CommandMethod("grpTRNLinks", "TRNLinks", "TRNlinks", Autodesk.AutoCAD.Runtime.CommandFlags.Modal)> _

 

changed it to match the statement in the plugin to


   <Autodesk.AutoCAD.Runtime.CommandMethod("GrpTRNLinks", "TRNLinks", Nothing, Autodesk.AutoCAD.Runtime.CommandFlags.Modal, Nothing, "MytestProject", "Command1")> _

 

and my xml to read ;

<Commands GroupName="grpTRNLinks">
                <Command Local="TRNLinks" Global=""/>

 

and changed nothing else, that seemed to do the trick. I am not sure what it is about this statement that is causing all the problem. Other than leaving the out the Global command, i do not see much difference. I have yet to replicate this with the other .dll that i have to load we will see.

Message 14 of 19
_gile
in reply to: dimitri


dimitri a écrit :
One important point is that I needed to install a later version of Visual Studio Express (only 2012 or 2013 versions are compatible with the framework 4.0, but only 2012 will run in Windows seven - with known issues...).

No.

Visual Studio 2010 supports Frameworks 2.0, 3.0, 3.5 and 4.0

Visual Studio 2012 supports Frameworks 2.0, 3.0, 3.5, 4.0 and 4.5

Visual Studio 2013 supports Frameworks 2.0, 3.0, 3.5, 4.0, 4.5 and 4.5.1

And Visual Studio 2013 works fine on Windows 7.

 

If you want to build an AutoCAD 2014 application, target the Framework 4.0 and you can use either VS 2010, VS 2012 or VS 2013.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 15 of 19
dimitri
in reply to: _gile

yep, I made a mistake

 

but I installed Visual Studio 2012 and it also supports Frameworks 4.51.

And when I tried to install Visual Studio 2013 it told me it was not compatible with my Windows 7 64 bit.

 

My goal was to build a Autocad 2015 application, so could not use the VS 2010...

Message 16 of 19
mcicognani
in reply to: dimitri

Weird, I'm using Windows 7 32 bit, and all VS installed from 2008 to 2013... I'm still on 32 bit because before 4.5.1 wasn't impossible to use the Edit & Continue feature, that to me is of greatest importance.

Also, I use a Windows 8.1 64bit machine, again with all VS installed from 2008 to 2013, again no problem.

 

Just a note to complete the information given about development platform: if you need to compile some ObjectArx DLLs (that's c++) please remember that AutoCAD 2015 is compiled with VS2012. You can still use VS2013, but you need VS2012 installed e you need to specify to use the compiler v.120, otherwise you'll get a link error.

 

For the auto-loading, I may suggest to use a working XML and just change as little as possible, you may use the one I attached to one of my earlier post.

Also, you may want to use an XML sintax checker (you can find them also working online), because a missing slash is easy to overlook, but can break the whole thing (yes, I'm talking out of experience Smiley Frustrated )

 

Message 17 of 19
augusto.goncalves
in reply to: mhama

@mhama

 

I took the original PackageContents.xml you sent and notice that the AppDescription is missing at the ComponentEntry, also, include LoadOnCommandInvocation="True" LoadOnRequest="True"

 

Finally, the ProductCode is only required for apps on the store, so we can control updates.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 18 of 19
mhama
in reply to: augusto.goncalves

The thread was going in a different direction and was not answering my question. Thanks for the update. I finally got it to work after fiddling with the packagecontents.xml. I wish they had something to produce the package file, this way people not well versed with XML can use that and make sure they have all the requirements right.

 

Thanks again

 

 

Message 19 of 19
joep
in reply to: mhama

We don't really nead a tool. Just a good schema would do the trick.

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