2 Replies Latest reply on Nov 18, 2010 4:36 AM by karl.kechele

    changing the display condition of a user layer




      I want to change the "Display_Condition" of an user layer via VBA in an excel file.

      When I create a cell object with the "Edit"-call I get a collection of all user layers.

      But in these user layers I cannot access the "Display_Condition" (only the property "Name" is accessable).

      How I can change the "Display_Confition" of an user layer?

      When I call the "Commit"-methode I get an error message.

      When I don't call all the "Commit"-methode I get an error when calling the sub twice.

      Whenn calling the methode libApp.CloseActiveDatabase or libApp.Quit I get also an error message.

      What should I do here?



      Karl Kechele


      The following script displays the user layers of a certain cell:

      Private Sub CommandButton1_Click()
        Dim ulayer
        Set my_cells = New Dictionary
        Dim cell As CellEditorAddinLib.cell
        Dim cellname As String
        Dim lib As CellEditorAddinLib.CellDB
        Set libApp = CreateObject("CellEditorAddin.CellEditorDlg")
        Set lib = libApp.OpenDatabase("H:\tmp\test_lib\test_lib.lmc", False)
        For Each cell In lib.ActivePartition.Cells
          my_cells.Add cell.Name, cell
        cellname = "ESDRAC10-005"

        Set cell = my_cells.Item(cellname)
        MsgBox (cell.Name)
        lidx = 8
        Set cellobj = cell.Edit
        For Each ulayer In cellobj.UserLayers
          Cells(lidx, 1) = ulayer.Name
          lidx = lidx + 1
      End Sub

        • 1. Re: changing the display condition of a user layer

          Hello kechele-san,


          I send a sample code.






          Private Sub Command1_Click()
              Dim celEditor As CellEditorAddinLib.CellEditorDlg
              Dim celDB As CellEditorAddinLib.CellDB
              Dim ptin As CellEditorAddinLib.Partition
              Dim cel As CellEditorAddinLib.Cell
              Dim cellname As String
              Dim ptname As String
              Dim celApp As MGCPCB.CellEditorApplication
              Dim celDoc As MGCPCB.Document
              Set celEditor = CreateObject("CellEditorAddin.CellEditorDlg")
              Set celDB = celEditor.OpenDatabase("D:\AutomationLayer\Candy_EE2007.7\TutorialCL\TutorialCL.lmc", False)
              ptname = "TEST"
              cellname = "ESDRAC10-005"
              'Locked CellDB
              'Find Patition
              For Each ptin In celDB.Partitions
                  If ptin.Name = ptname Then Exit For
              If ptin Is Nothing Then
                  Set ptin = celDB.NewPartition(ptname)
              End If
              'Create New Cell
              Set cel = ptin.NewCell(ecelldbCellTypeDrawing)
              'Set Cell Name
              cel.Name = cellname
              'Set Cell Unit
              cel.Units = ecelldbUnitMM
              'Cell Commit
              Call cel.Commit
              Set celDoc = cel.Edit
              Set celApp = celDoc.Application
              'Put Fablication Layer
              Call celDoc.PutFabricationLayerText(cellname, 0, 0, epcbFabAssembly, epcbSideTop)
              'Close Cell
              Call celDoc.Close(True)
              'Quit Cell Editor(Layout)
              Call celApp.Quit
              'UnLocked CellDB
              Call celEditor.UnlockServer
              'Close CellDB
              Call celEditor.CloseActiveDatabase(True)


          End Sub

          • 2. Re: changing the display condition of a user layer

            How I change the display condition for a package cell (ecelldbCellTypePackage) ?

            A package cell must have pins, but when I set the PinCount to "1" I get an error message.

            There is not a call like "AddPin".


            Thank you.