AppAutoload in 2013 LoadOnCommandInvocation seems broken

AppAutoload in 2013 LoadOnCommandInvocation seems broken

tyronebk
Collaborator Collaborator
2,974 Views
22 Replies
Message 1 of 23

AppAutoload in 2013 LoadOnCommandInvocation seems broken

tyronebk
Collaborator
Collaborator

I have searched but have been unable to find anything related to this. This is not strictly a .net issue.

Is LoadOnCommandInvocation="True" broken in 2013? It used to work fine in 2012 but in 2013 all .DLL and lisp files are simply being loaded at launch?

Even the simple DOTNETTEST2 bundle (made available by the APN Dev guys last year) show the same behaviour.

Is there something I'm missing?

Here's the PackageContents.xml from the DOTNETTEST2:

Spoiler

<?xml version="1.0" encoding="utf-8" ?>

<ApplicationPackage SchemaVersion="1.0" >

<Components>

<ComponentEntry AppName="DOTNETTEST2" ModuleName="./Contents/2013/AutoloaderDotNetSample2.dll" LoadOnCommandInvocation="True" >

<Commands GroupName="DevDays2010">

<Command Global="DOTNETTEST2" Local="DOTNETTEST2" />

</Commands>

</ComponentEntry>

</Components>

</ApplicationPackage>

I searched through the now redacted SP 1 release notes and saw no mention of this problem.

0 Likes
Accepted solutions (1)
2,975 Views
22 Replies
Replies (22)
Message 21 of 23

Anonymous
Not applicable

No luck I’m afraid.

 

Specifying group name in CommandMethod as following: [CommandMethod("HW_Group", "HW_HelloWorld", CommandFlags.Modal)] makes no difference for me. Still it works fine in Civil 2013, but it does not work in Civil 2014, unless I change LoadOnCommandInvocation with LoadOnAutoCADStartup. Is there any other attributes I need to set?

 

I have tried calling the command from command line as HW_HelloWorld and HW_Group.HW_HelloWorld. In both cases I am getting “Unknown command "HW_HELLOWORLD".  Press F1 for help”.

 

Just to clarify, I am using AutoCAD Civil 3D 2014 SP1, with Product Version stated as I.108.0.4, SP1.

0 Likes
Message 22 of 23

StephenPreston
Alumni
Alumni
Accepted solution

I don't have Civil 3D installed, so I used a test DLL with AutoCAD 2014. I got this XML to work for LoadOnCommandInvocation:

 

<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage SchemaVersion="1.0" Name="Hello World" ProductCode="{EEA4994B-1F8F-44AD-A989-BC04E80FE71E}">
 <CompanyDetails Name="Hello World Engineering" Email="support@hello.world"/>
  <Components>
    <RuntimeRequirements SupportPath="./Contents" Platform="AutoCAD|Civil3D" OS="Win64" SeriesMin="R19.0" SeriesMax="R19.1" />
    <ComponentEntry AppName="HelloWorld" ModuleName="./Contents/YOURDLLNAME.dll" AppDescription="Hello World test module" LoadOnCommandInvocation="True">
      <Commands GroupName="HW_Group">
        <Command Local="HW_HelloWorld" Global="HW_HelloWorld" />
      </Commands>
    </ComponentEntry>
  </Components>
</ApplicationPackage>

 

But I'm seeing some unexpected behavior - LoadOnCommandInvocation seems to breakif I delete one or both of the Appname or AppDescription parameters from the <ComponentEntry/> element.

 

As long as you include all the elements and parameters in my example above you should be fine. But I consider the requirement for an 'AppDescription' to be a bug (one could argue that AppName could be useful for tracking in the registry). I'll go ahead and report that to our dev team.

 

Please test this yourself on C3D and see if it works now.

 

 

Cheers,

Stephen Preston
Autodesk Developer Network
Message 23 of 23

Anonymous
Not applicable

Adding AppDescription attribute to ComponentEntry element does the trick.

I can confirm LoadOnCommandInvocation works on Civil 2014, then AppDescription is specified.

 

Thank you for your help Stephen

All the best

0 Likes