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

LoadOnCommandInvocation and autocomplete causing command not to work

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
574 Views, 3 Replies

LoadOnCommandInvocation and autocomplete causing command not to work

So I am new to .net.


I was previously installing my program by adding the registry entries manually (Oops!)

 

I have now changed to using the Autoloader and PackageContents.xml.

 

The program is correctly loaded, as some commands will work immediately. Other commands do not work if they are the first command to be run on after starting autoCAD.

 

I believe this to be autoCAD's autocomplete feature. The commands that do not work are not recognized but close enough to an existing command for autocad to 'Autocorrect' them. 

 

Once I have run a command that does not autocorrect, all other commands then work fine. 

 

I've tried changing LoadOnCommandInvocation to false but it didn't appear to change an thing. Any help?

 

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

<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD" ProductType="Application" Name="DrgNo" AppVersion="1.0.0" Description="MBVE Plugin: DrgNo" Author="Redacted" Icon=".\Contents\Resources\DH.png" AppNameSpace="" OnlineDocumentation="Redacted" HelpFile="./Contents/Resources/DrgNoHelp.htm" ProductCode="Redacted" UpgradeCode="Redacted" SupportedLocales="Enu">

  <CompanyDetails Name="Vital Energi" Phone=" " Url="Reacted" Email="Redacted" />

  <Components>

    <RuntimeRequirements SupportPath="./Contents/Resources" OS="Win32|Win64" Platform="AutoCAD|Civil3D|Map|AIS|ADT|ACADM|MEP|ACADE|PNID|Plant3D|Civil|LDT" SeriesMin="R20.1" SeriesMax="R20.1" />

    <ComponentEntry AppName="DrgNo" Version="1.0.0" ModuleName="./Contents/Windows/GetDrgNo.dll" AppDescription="MBVE: DrgNo" LoadOnCommandInvocation="False" LoadOnRequest="True">

      <Commands GroupName="MBVEDRGNO">

<Command Global="DrgNo" />
<Command Global="Stamp" />
<Command Global="Scalebar" />
<Command Global="IB" />
<Command Global="GBP" />
<Command Global="ImportBlocks" />

      </Commands>
    </ComponentEntry>
    <ComponentEntry AppName="DrgNo" Version="1.0.0" ModuleName="./Contents/Resources/DH.cuix" AppDescription="MBVE: DRGNO" LoadOnAutoCADStartup="True" />
  </Components>
</ApplicationPackage>
3 REPLIES 3
Message 2 of 4
_gile
in reply to: Anonymous

Hi,

 

I think you're right, AutoCAD autocomplete cannot recognize your commands while the DLL is not loaded and the DLL won't load until one of your command is launched.

 

So, if you can/want, change the command names so that autocomplete do not find a match with an existing command. It's a good practice to prefix your GroupName and Command names with some symbol (your Registered Developer's Symbol if any).

Or change the plugin load reasons to: LoadOnAutoCADStartup="True".

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 4
Anonymous
in reply to: _gile

Hi Gile,

 

Thanks for the reply. Your previous posts have been very helpful before!

 

I have since posting read the white paper here:

http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html

 

I have tried removing loadOnCommandInvocation and defining LoadOnStartup = "True", but AutoCad is still not recognizing my commands.

 

I have also added local and global commands using a developers symbol. 

 

However, autocorrect will still not pick up my commands!

It will pick up commands after using one that does not autocomplete, but not before. Even with the below .xml

 

I would also like a resolution that doesn't mean shoehorning commands into what is left over from autocomplete as this inhibits sensible naming!

 

 

 

 

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

<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD" ProductType="Application" Name="DrgNo" AppVersion="1.0.0" Description="MBVE Plugin: DrgNo" Author="Redacted" Icon=".\Contents\Resources\DH.png" AppNameSpace="" OnlineDocumentation="Redacted" HelpFile="./Contents/Resources/DrgNoHelp.htm" ProductCode="{42CEC65C-2145-4344-8242-E65D7992C1B8}" UpgradeCode="{8AB3852F-C9CF-4460-9A6B-E43D93F5091F}" SupportedLocales="Enu">

  <CompanyDetails Name="Vital Energi" Phone=" " Url="Redacted" Email="Redacted" />

  <Components>

    <RuntimeRequirements SupportPath="./Contents/Resources" OS="Win32|Win64" Platform="AutoCAD|Civil3D|Map|AIS|ADT|ACADM|MEP|ACADE|PNID|Plant3D|Civil|LDT" SeriesMin="R20.1" SeriesMax="R20.1" />

    <ComponentEntry AppName="DrgNo" Version="1.0.0" ModuleName="./Contents/Windows/GetDrgNo.dll" AppDescription="MBVE: DrgNo" LoadOnAutoCADStartup = "True">

      <Commands GroupName="MBVEDRGNO">

<CommandLocal="DrgNo"Global="MBVE_DrgNO"/>
<CommandLocal="Stamp"Global="MBVE_Stamp"/>
<CommandLocal="Scalebar"Global="MBVE_Scalebar"/>
<CommandLocal="IB"Global="MBVE_IB/>
<CommandLocal="GBP"Global="MBVE_GBP"/>
<CommandLocal="ImportBlocks"Global="MBVE_ImportBlocks"/>


      </Commands>
    </ComponentEntry>
    <ComponentEntry AppName="DrgNo" Version="1.0.0" ModuleName="./Contents/Resources/DH.cuix" AppDescription="MBVE: DRGNO" LoadOnAutoCADStartup="True" />
  </Components>
</ApplicationPackage>

 

 

Message 4 of 4
Anonymous
in reply to: _gile

Hi Gile,

 

Nevermind, I think trying to do local and global names messed something up.

 

LoadOnStartup = "True" works with the below .xml

 

Not the greatest solution since I would prefer to demand load, but maybe I will split the plugin so that I limit what I load on startup.

Thanks.

 

 

 

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

<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD" ProductType="Application" Name="DrgNo" AppVersion="1.0.0" Description="MBVE Plugin: DrgNo" Author="Martin Brookes" Icon=".\Contents\Resources\DH.png" AppNameSpace="" OnlineDocumentation="https://vitalenergi.cloudapp.net/busdev/energysolutions/Pages/default.aspx" HelpFile="./Contents/Resources/DrgNoHelp.htm" ProductCode="{42CEC65C-2145-4344-8242-E65D7992C1B8}" UpgradeCode="{8AB3852F-C9CF-4460-9A6B-E43D93F5091F}" SupportedLocales="Enu">

  <CompanyDetails Name="Vital Energi" Phone=" " Url="https://vitalenergi.cloudapp.net/busdev/energysolutions/Pages/default.aspx" Email="martin.brookes@vitalenergi.co.uk" />

  <Components>

    <RuntimeRequirements SupportPath="./Contents/Resources" OS="Win32|Win64" Platform="AutoCAD|Civil3D|Map|AIS|ADT|ACADM|MEP|ACADE|PNID|Plant3D|Civil|LDT" SeriesMin="R20.1" SeriesMax="R20.1" />

    <ComponentEntry AppName="DrgNo" Version="1.0.0" ModuleName="./Contents/Windows/GetDrgNo.dll" AppDescription="MBVE: DrgNo" LoadOnAutoCADStartup = "True">

      <Commands GroupName="MBVEDRGNO">
<Command Global="DrgNo" />
<Command Global="Stamp" />
<Command Global="Scalebar" />
<Command Global="IB" />
<Command Global="GBP" />
<Command Global="ImportBlocks" />


      </Commands>
    </ComponentEntry>
    <ComponentEntry AppName="DrgNo" Version="1.0.0" ModuleName="./Contents/Resources/DH.cuix" AppDescription="MBVE: DRGNO" LoadOnAutoCADStartup="True" />
  </Components>
</ApplicationPackage>

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report