2 Replies Latest reply on Aug 26, 2010 7:39 AM by eddy.muliyanto

    Modify Pinmapping (PartsEditor) using Automation

    eddy.muliyanto

      Is it possible to modify pinmapping using Automation?

      Can some one give me a sample code how to read and write the mapping between symbol pin and real pin?

      Thanks a lot.

        • 1. Re: Modify Pinmapping (PartsEditor) using Automation
          john_dube

          Hi Eddy,

           

          It is possible to create new pin mapping through automation, there are examples in the documentation.

           

          You probably will not be able to modify an existing pin mapping, there is no way to delete a symbol or cell reference.

           

          The only way to modify the existing pin mapping would be to build a copy of the part with appropriate modifications, then delete the old part.

           

          For reading the mapping between logical pin name and physical pin number, this simple loop will print the logical to physical mapping for every part in a library:

           

          sLmcPath = "C:\MentorGraphics\7.9EE\SDD_HOME\standard\examples\SampleLib2007\SampleLib.lmc"
          Set pdbEd = CreateObject("MGCPCBLibraries.PartsEditorDlg")
          Set pdbDB = pdbEd.OpenDatabaseEx(sLmcPath, True)
          For Each pdbPartition In pdbDB.Partitions
          For Each pdbPart In pdbPartition.Parts
          WScript.Echo pdbPartition.Name & ":" & pdbPart.Name
          Set pdbMapping = pdbPart.PinMapping
          For Each objSlot In pdbMapping.Slots
          For Each objPinInstance In objSlot.Pins
          sPinName = objPinInstance.Name
          If sPinName = ""Then
               sPinName = objSlot.Gate.Name
          EndIf
          WScript.Echo "  " & sPinName & " => " & objPinInstance.Number
          Next
          Next
          Next
          Next
          pdbEd.CloseActiveDatabase False
          Set pdbDB = Nothing
          Set pdbEd = Nothing
          John