3 Replies Latest reply on Jan 25, 2017 8:44 AM by wes_cessnun

    Script to replace part in xDxDesigner VX.2.1

    wes_cessnun

      Is there a way to replace a part from the the central library with the rotation that we want? We can find all the same part number but are unable to figure out how to replace the part from in the schematic. The problem is we have .1 through .8 symbols and with the new library it is only a .1 symbol with 8 rotations. we need to make each .1 through .8 symbol the equivalent to what is in the Library as .1 with (0,90,180,270,0M,90M,180M, 270M). Any help with knowing how to Replace part through automation in a schematic would be helpful.

        • 1. Re: Script to replace part in xDxDesigner VX.2.1
          wes_cessnun

          It looks like we need to find the symbol name in the schematic. Anyone know how to find the symbol name. We can get almost all the other properities just unable to find a way to see what this one is.

          • 2. Re: Script to replace part in xDxDesigner VX.2.1
            nick_hong

            Hi wes_cessnun,

             

            SymbolBlock.SheetNum holds the current 'page' of the symbol, so you will be able to identify full symbol name by concatenating SymbolBlock.GetName and SymbolBlock.SheetNum

            Please try below code snippet in xDxDesigner. It will work when there is any component selected in your schematic sheet.

            Set oView = Application.ActiveView

            If oView Is Nothing Then

              MsgBox "There is no active schematic view.", vbExclamation

            Else

              Set colComps = oView.Query(VDM_COMP, VD_SELECTED)

              If colComps.Count = 0 Then

                MsgBox "Please select component(s) and run again", vbExclamation

              Else

                For Each oComp In colComps

                  sUID = oComp.UID

                  sRef = oComp.RefDes

                  sSymbolName = oComp.SymbolBlock.GetName(SHORT_NAME)

                  sSheetNum = oComp.SymbolBlock.SheetNum

                  MsgBox "UID : " & sUID & vbCrLf & _

                         "Ref : " & sRef & vbCrLf & _

                         "Symbol : " & sSymbolName & "." & sSheetNum

                Next

              End If

            End If

             

            Hope the above helps,

            Nick

            • 3. Re: Script to replace part in xDxDesigner VX.2.1
              wes_cessnun

              Thanks for the information. We had found how to do this and it is very similar to what you have there.