Our AutoCAD .NET Wizard project template downloadable from the AutoCAD Developer Center includes some boilerplate code to demonstrate how to create various command types. The first command definition looks like this:
_ Public Sub MyCommand() ' This method can have any name ' Put your command code here End Sub
A common misunderstanding is thinking that the “MyCommandLocal” string is actual localized command name – someone making that mistake will try to edit that string to create a new localized command name. This string is actually the Id of a string resource in the project, and it’s the string resource that contains the localized commandname. You can see this by clicking the ‘Show All Files’ button in the Visual Studio Solution Explorer and double clicking on the myCommands.resx file.
This opens up the resource file, where you can edit the resource string:
Kean covered this topic back in 2009, and included instructions for creating additional localized resx files to allow your plug-in to support multiple languages. I’m restating it now because we still receive questions on this from time to time.
Once you’ve created your localized plug-in, you can set localized command names in your Autoloader PackageContents.xml file too. For example, here is a <Commands/> group defining a <Command/> that has a global and local name:
<Commands GroupName="ADNPLUGINS">
<Command Local="BATCHPUBLISH" Global="BATCHPUBLISH" />
</Commands>
You can add additional per local localized names like this:
<Commands GroupName="ADNPLUGINS">
<Command LocalEnu="BATCHPUBLISH_IN_ENGLISH" LocalDeu="BATCHPUBLISH_IN_GERMAN" LocalFra="BATCHPUBLISH_IN_FRENCH" Global="BATCHPUBLISH" />
</Commands>
and so on …


Leave a Reply