5 Replies Latest reply on Sep 17, 2015 2:01 AM by tehte

    Open Cell Editor in edit mode from Library Manager using scripting

    tehte

      I am trying to run a script below from Open Form Script functionality in Library Manager just to open Cell Editor application in edit mode. Unfortunately, my Cell Editor hangs. I am in EE7.9.4. Appreciate any advise.

       

       

      Option Explicit

       

      ' Get the Cell Editor

      Dim cellEdObj

      Set cellEdObj = CreateObject ("CellEditorAddin.CellEditorDlg")

      Scripting.AddTypeLibrary ("CellEditorAddin.CellEditorDlg")

       

      ' Get the Cell database to read/write

      Dim cellDB

      Set cellDB = cellEdObj.OpenDatabase("C:\MentorLibraries\DxD_Exp\Library.lmc")

      cellEdObj.Visible = False

      cellEdObj.LockServer()

      Dim cellpartition : Set cellpartition = cellDB.Partitions.Item("smd_conn")

      Dim cell : Set cell = cellpartition.Cells.Item("cn00461") 'Get the cell in question

      Dim ecell : Set ecell = cell.Edit()

      ecell.Application.Visible = True

        • 1. Re: Open Cell Editor in edit mode from Library Manager using scripting
          Satoru

          Hi,

           

          You have started only Cell Editor.

          If Cell Editor is controlled only by Scpipt, it will work by this method.

          But to operate an editor, it is necessary to start Cell Editor from Library Manager.

           

          Please try this code.

          Satoru

           

          ------------------------------------------------------------------------------------------------------------

          Option Explicit

           

          ' Create Library Manager

          Dim lmcApp

          Set lmcApp = CreateObject("LibraryManager.Application")

          Scripting.AddTypeLibrary("LibraryManager.Application")

          lmcApp.Visible = True

           

          'Open lmc File

          Dim lmcLib

          Set lmcLib = lmcApp.OpenLibrary("C:\MentorLibraries\DxD_Exp\Library.lmc")

           

          ' Get the Cell Editor

          Dim cellEdObj

          Set cellEdObj = lmcLib.CellEditor

          Scripting.AddTypeLibrary ("CellEditorAddin.CellEditorDlg")

           

          ' Get the Cell database

          Dim cellDB

          Set cellDB = cellEdObj.ActiveDatabase

          cellEdObj.Visible = False

          cellEdObj.LockServer()

          Dim cellpartition : Set cellpartition = cellDB.Partitions.Item("smd_conn")

          Dim cell : Set cell = cellpartition.Cells.Item("cn00461") 'Get the cell in question

           

          Scripting.AddTypeLibrary("MGCPCB.CellEditorApplication")

          Dim ecell : Set ecell = cell.Edit()

          ecell.Application.Visible = True

          • 2. Re: Open Cell Editor in edit mode from Library Manager using scripting
            tehte

            I already in Library Manager session. I do not like to open another Library Manager when opening Cell Editor.

            • 3. Re: Open Cell Editor in edit mode from Library Manager using scripting
              Satoru

              Try start the CellEditor70.exe by command line.

               

              <example command>

                D:\MentorGraphics\7.9.5EE\SDD_HOME\lm\win32\bin\CellEditor70.exe D:\DxD_Exp\Library.lmc -Caller LibMan -BU 1NM -Partition smd_conn -Cell cn00461

               

              Satoru

              • 4. Re: Open Cell Editor in edit mode from Library Manager using scripting
                jeremy_parker

                If you have Library Manager open and are connected to it through automation using:

                 

                libApp = GetObject(, "LibraryManager.Application")

                libDoc = libApp.ActiveLibrary

                 

                Then you can quickly get to cell editor like this:

                 

                Dim cellEd As CellEditorAddinLib.CellEditorDlg = libDoc.CellEditor

                Dim cellDB As CellEditorAddinLib.CellDB = cellEd.ActiveDatabase

                • 5. Re: Open Cell Editor in edit mode from Library Manager using scripting
                  tehte

                  Thanks Satoru! Your code below works perfectly well for me.

                   

                  <example command>

                    D:\MentorGraphics\7.9.5EE\SDD_HOME\lm\win32\bin\CellEditor70.exe D:\DxD_Exp\Library.lmc -Caller LibMan -BU 1NM -Partition smd_conn -Cell cn00461

                   

                  Hi Jeremy, your code works fine too but sometimes my LibraryManager.exe session crashes because of ExpeditionMiniDumps issue when running multiple sessions of Library Manager and DMS Librarian sessions. Satoru's code is more easy to control in my case.

                   

                  Thanks both of you!