Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

ARES commander provide .NET API to author third party Plugin Software for ARES Commander.

Supported API Sets 

ARES Supports 3 API sets which can be used independently

  1. .NET Classic API
  2. ARES COM API
  3. CFx .NET(SWIG generated .NET API version of ARES C++ SDK)
API Assembly NamesNature of PluginLoading Mechanism
NET Classic API

TD_Mgd_x.xx_xx.dll

FxCoreMgd_x.xx_xx.dll

In-processUse NETLOAD command

ARES COM API

ARESC.exe

OdaX_x.xx_xx.dll

TD_Mgd_x.xx_xx.dll(For In-process plugin only)

In-process

Out-process

  •  In-process-Use NETLOAD command
  • Out-rocess-  Runs as a separated EXE

CFx .NET

ArgonMGD.dll

TD_SwigCoreMgd.dll

TD_SwigDbMgd.dll

TG_SwigDbMgd.dll

TD_Mgd_x.xx_xx.dll

In-processUse NETLOAD command

.NET Classic Plugin:

  • Create a new C#  or VB.NET project  using Visual Studio project Wizard( **minimum requirement .NET Framework v4.5)
    • Add references from Solution Explore of TD_Mgd_x.xx_xx*.dll and FxCoreMgd_x.xx_xx.dll by Browsing ARES installation folder.
    • Developer can see available NameSpaces,Classes,Methods, Properties in each assembly using Object Browser

                 





  • Rename Class1.cs tp PluginCommands.cs it will change class Class1 to class PluginCommands like below.


  • Defining a command use Teigha.Runtime namespace to access CommandMethod method atrribute as below and add a method i.e AnyFunctionName having this attribute. It define MySampleCommand command which can be executed on ARES Commandline.
  •  
  • The above procedure is similar to all type of in-process plugn.
  • Build the sample project is will generate PluginCommans.dll or <YourProjectName.dll>
  • Run ARES and type NETLOAD on command line it will prompt to load the plugin dll, browse PluginCommands.dll and Load, message of successful loading will appear on command line.
  • Run MySampleCommand AnyFunctionName method will be executed. 

Accessing Application Object

Accessing Documents and ActiveDocument

From application object one can access document manager, Document Manager has peroperties and Methods by which one can access active document and also can add new document or open existing drawings.

 


Promping for User input 

For user IO Editor class is responsible, one can get it from Document and all related class for UserIO are available in Teigha.EditorInput namespace.


            Document activeDocument = docManager.MdiActiveDocument;
            Editor ed = activeDocument.Editor;

            PromptIntegerOptions op = new PromptIntegerOptions("Input a positive integer");
            op.AllowNegative = false;
            PromptIntegerResult res =(PromptIntegerResult) ed.DoPrompt(op);
            if( res.Status == PromptStatus.OK)
            {
                int retVal = res.Value;
            }


  • No labels