2 Replies Latest reply on Apr 20, 2011 10:13 PM by merlin





      I can copy parts in my centrallibrary by script and set the properties. The news infomation about part.name and the properties are in an excel-sheet.

      but I can set the new description, is there anybody who can help?


      Here is a shortcut of my script:



      Set fso = CreateObject("Scripting.FileSystemObject")
      Set oFile = fso.OpenTextFile("C:\temp\log1.txt",8,true)

      'sTable = "Resistors"
      sTable = "capacitor"

      ' Create the PDBEditor object
      Dim pdbEditor
      Dim activeDatabase
      dim oPartition

      Set pdbEditor = GetObject(,"MGCPCBLibraries.PartsEditorDlg")
      set activeDatabase = pdbEditor.ActiveDatabaseEx

      Dim ainhalt, i, TZ, y, binhalt, cinhalt, WScript, objXLS, XL, Paul, PropName
      Dim dinhalt, einhalt, finhalt, ginhalt, hinhalt, iinhalt, jinhalt, kinhalt, linhalt, minhalt, ninhalt, oinhalt
      PfadXLS = "J:\Test_Liste.xls"
      set objXLS = CreateObject("Excel.Application")
      objXLS.Visible = True
      objXLS.DefaultFilePath = PfadXLS
      set Paul = objXLS.Workbooks.Open(PfadXLS)

      for each oPartition in activeDatabase.Partitions  
          if oPartition.Name = sTable then
              for each oPart in oPartition.Parts
                  i = 2
                  For i = 2 to 63335
                  binhalt = objXLS.Range("B" & i).Value
                  'MsgBox binhalt
                      If binhalt = "" then
                          i = 63335
                          'MsgBox ("ENDE")
                          'Call Raus()
                      End If   
                      If oPart.Name = binhalt Then
                          oPartDesc = oPart.Description
                          oPartVal = oPartDesc
                          'For Each oDevProp in oPDBDevColl
                              pinhalt = objXLS.Range("P" & i).Value
                              'PropName = oPDBDevColl
                              'If PropName = "Description" Then
                              'MsgBox oDevProp.Value
                              oPartVal.copy pinhalt
                              'End If   
                      End If       
          End If
      set activeDatabase = nothing
      set pdbEditor = nothing

      msgbox "Ready"


      best regards