3 Replies Latest reply on Jan 31, 2014 3:36 PM by kendall_hiles

    Expedition Attached Properties on a Part

    flatheadbob

      Because of our Test Dept. we need to add two testpoints for each side of a resistor that is 100 ohm and less.  I'm writing a script that finds all resistors on a board that are 100 ohms and less and then selects them so we physically see which resistor cells need this special treatment. 

       

      I can muddle through most of the script, but for some reason I'm have a difficult time figuring out how to get the "Value" property of the resistors.  If anyone can help me get just that one line in vbscript form, I would appreciate it!

      prop.png

        • 1. Re: Expedition Attached Properties on a Part
          kendall_hiles

          Once you find the part, wlak through the part properties, here is a screenshot from my VB6 session.  You can see the parts Ref Des starts with an "R" so I walk though the Properties until I get the Name "Value" Then I get the Value.  Confusing if your not using the debugger in Excel or VB6.

           

              Dim comp 'As Component
              Dim comps 'As Components
              Set comps = pcbDoc.Components(epcbSelectAll)
             
              For Each comp In comps

                  If Left(comp.RefDes, 1) = "R" Then
                      'Debug.Print comp.Name
                      Set props = comp.Properties

                      For Each prop In props

                          If prop.Name = "Value" Then
                              If prop.Value < 100 Then
                                  comp.Selected = True
                              End If
                          End If

                      Next

                  End If
             
              Next

          VB6_COMP_VALUE.png

          -Kendall

          • 2. Re: Expedition Attached Properties on a Part
            flatheadbob

            Thanks Kendall!  You make it look so simple.  Appreciate you taking the time...

            • 3. Re: Expedition Attached Properties on a Part
              kendall_hiles

              No problem Flathead, I'll convert you to direct injection diesel soon enough.

               

              -kendall