6 Replies Latest reply on Feb 20, 2018 7:03 AM by chris.smith

    Export Selected items ...

    md.direct

      Hi All,

       

      Is there a way to export (report) selected items to a text file ?

      Similar to what Selection List is displaying ?

       

      Thx

        • 1. Re: Export Selected items ...
          Patrick.Cashman

          Yes.  You can get lots of information about whatever items you have selected.  Component properties, location, etc. can all be captured by automation.  Question is what do you want to collect and how do you want to format it in the text file.

          • 2. Re: Export Selected items ...
            fuba

            Hi, and yes it is possible like mentioned by Patrick. But you need to give us a direction. Are you looking for exported data from

            • Schematic
            • PCB
            • Variant Manager
            • ...

            what are you using / what are you lookign for ?

             

            Bye

            • 3. Re: Export Selected items ...
              md.direct

              Thank you all for your answers. I finally found a script that does basically what I want.

               

              Expedition : Report Selected Components

              • 4. Re: Export Selected items ...
                chris.smith

                We are looking to be able to get information from schematic symbol selection (s). As an current example you can not copy the symbol name from a selected symbol in the XDX properties gui. It is blocked from accidental changes perhaps, but you are unable for a symbol name field selection and copy.

                • 5. Re: Export Selected items ...
                  Patrick.Cashman

                  The following script gets both the symbol name and another property value you can specify.  Run it by pasting the following command into the command line toolbar in DxDesigner:

                  run <script_path>script_name.vbs

                   

                  Where <script_path> is the folder location of the script file and script_name.vbs is the name of the script file.

                   

                  Here is the script: (you can copy this directly into a text editor and save it to a file like get_prop_value.vbs, then run as above.)

                   

                  Public app

                  Public view

                   

                  Main

                   

                  Sub Main()

                  dim prop_name

                  dim str

                  set app = GetObject(,"ViewDraw.Application")

                  prop_name = InputBox("What property name do you want values for?")

                  str = get_prop_value(prop_name)

                  msgbox "str is " & vbcrlf & str

                  End Sub

                   

                  Function get_prop_value(prop_name)

                          Dim comps

                          Dim comp

                          Dim value

                          Dim attr

                          Dim refdes

                          Dim str

                          Dim sym

                          Dim ary

                          Dim symbolname

                  set view = app.ActiveView

                          set comps = view.Query(128, 1)

                  str = ""

                          For Each comp In comps

                              refdes = comp.Refdes

                              set attr = comp.FindAttribute(prop_name)

                  if not attr is nothing then

                  value = attr.Value

                  end if

                              set sym = comp.SymbolBlock

                              ary = Split(sym.GetName(1), ".")

                              symbolname = ary(0)

                              If Not attr Is Nothing Then

                                  str = str & refdes & vbTab & symbolname & vbTab & attr.Value & vbCrLf

                              End If

                          Next

                          get_prop_value = str

                      End Function

                  2 of 2 people found this helpful
                  • 6. Re: Export Selected items ...
                    chris.smith

                    Thanks for sharing Patrick.

                     

                    I appreciate the time and direct help.