Eplan Platform API
Eplan.EplApi.System Namespace / EplApplication Class
Members Example

In This Topic
    EplApplication Class
    In This Topic
    This class allows you to use EPLAN functions in other processes.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.System.EplApplication

    Syntax
    public class EplApplication 
    public ref class EplApplication 
    Remarks
    External applications can use EPLAN functions by generating an instance of this class and calling the Init(String) function.
    Example
    This example initializes and closes EPLAN.
    namespace Eplan.Api.Offline
    {
        public partial class MainDialog : Form
        {
            //EPLAN application object
            private EplApplication m_oEplApp = new EplApplication();
    
            //flag for detemining if initialization has been already done
            private bool m_bIsP8AlreadyInitialized = false;
    
            //path to EPLAN bin folder
            private string m_strEplanBinFolder = "";
    
            public MainDialog(String strEplanBinFolder)
            {
                //remember oath to bin folder
                m_strEplanBinFolder = strEplanBinFolder;
    
                //initialize dialog components
                InitializeComponent();
            }
    
            //Method for handling event which fires on clicking a control.
            private void btnStart_Click(object sender, System.EventArgs e)
            {
                EPLInit();
            }
    
            //Method for handling event which fires when closing a form. 
            private void mainDialog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
            {
                EPLExit();
            }
    
            //Method for initializing EPLAN
            private void EPLInit()
            {
                try
                {
                    if (!m_bIsP8AlreadyInitialized)
                    {
                        if (!String.IsNullOrEmpty(m_strEplanBinFolder))
                        {
                            m_oEplApp.EplanBinFolder = m_strEplanBinFolder;
                        }
                        m_oEplApp.Init("");
                        m_bIsP8AlreadyInitialized = true;
                    }
                }
                catch (Exception)
                {
                    //ToDo add an exception handling code here
                }
    
            }
    
            //Method for deinitialization EPLAN
            private void EPLExit()
            {
                try
                {
                    if (m_bIsP8AlreadyInitialized)
                    {
                        m_oEplApp.Exit();
                        m_bIsP8AlreadyInitialized = false;
                    }
                }
                catch (Exception)
                {
                    //ToDo add an exception handling code here
                }
    
            }
        };
    }
    
    
    Public Constructors
     NameDescription
    Public ConstructorCreates a new application class for EPLAN  
    Top
    Public Fields
     NameDescription
    Public Fieldstatic (Shared in Visual Basic)License runtime check callback event  
    Top
    Public Properties
     NameDescription
    Public PropertyPath to w3u.exe of your variant you want to start. Setting this path is necessary to specify the variant to start for your Offline application.  
    Public Propertystatic (Shared in Visual Basic)When the P8 version is started offline, no P8 mainframe is available. Then this function returns true.  
    Public PropertyGets application's license variant as string.  
    Public PropertyName of the File (inclusive path) containing the license to use or to borrow IMPORTANT: Set this path before calling Init!  
    Public PropertySet user password  
    Public PropertyQuiet mode in which EPLAN P8 has been started.  
    Public PropertySystem configuration scheme name.  
    Public PropertySet user name  
    Public PropertyGets application's variant as string (Basic, Trial, Developer, etc.).  
    Public PropertyGets version from the application.  
    Top
    Public Methods
     NameDescription
    Public MethodExits the EPLAN runtime system.  
    Public MethodOverloaded. Initializes the EPLAN runtime system.  
    Public MethodSets application's GUI language. Used before calling Init method.  
    Public MethodDisplays the EPLAN Open project dialog and opens the selected project.  
    Public MethodWhen a mainframe is set for API offline programs some dialogs which are normally hidden in API add-ins are shown. Calling this method will automatically hide them like in add-ins.  
    Public MethodSets a new Mainframe for API offline program. API offline program will show all dialogs which are normally hidden in add-ins. It is possible to hide such dialogs using ResetQuietMode method.  
    Public MethodDisplays the EPLAN API add-ins dialog.  
    Public MethodOverloaded. Selects parts from the current parts database  
    Public MethodDisplays the EPLAN settings dialog.  
    Public MethodDisplays the EPLAN System error messages dialog.  
    Top
    See Also

    Reference

    EplApplication Members
    Eplan.EplApi.System Namespace
    UsingEplanAssemblies.html