8 Replies Latest reply on Nov 4, 2018 8:24 AM by peter_festesen

    Trace length from pin to pin


      Hello All,


      Can anybody tell me, how to use Automation in ExpeditionPCB to get a trace length from one pin to another pin? The Traces collection for a selected net gives me the length of its segments (without any reference to pins of this net), rather than from pin to pin. In one topic I have read an advice to form a pin-pair in CES, assign some rule to it, then annotate the actual values from ExpeditionPCB back to CES. But I would use Automation only in ExpeditionPCB, without using CES.



        • 1. Re: Trace length from pin to pin

          Hi Oleg,


          You can use the ObjectsInBetween method to find the traces that connect two pins, then get the length of those traces.


          Here is a function that calculates the length between two pins:


          Function TraceLength(oPin1, oPin2)

               Dim dLen : dLen = 0.0


               ' get all the things between the two pins

               Dim objs : set objs = pcbDoc.ObjectsInBetween(oPin1, oPin2)


               ' if the collection is empty then it means there was no physical

               ' connection between the two pins.

               If objs.count > 0 Then


                    ' for each object in between the two pins; add up the delays from

                    ' all the traces in between the two pins. If we know the delay for

                    ' a via we could also include those.

                    Dim I, ob

                    For I = 1 To objs.Count

                         ' if something on a conductive layer

                         Set ob = objs.Item(I)

                         If ob.ObjectClass = epcbObjectClassConductorLayerGfx Then

                              ' must be a trace or an area on a conductor layer

                              If ob.Type = epcbCondGfxTrace then

                                   dLen = dLen + ob.Length

                              End If

                         End If


               End If

               TraceLength = dLen

          End Function



          1 of 1 people found this helpful
          • 2. Re: Trace length from pin to pin

            John, thank you very much. This is just what I need. Surprisingly, I haven't noticed such method earlier.


            • 3. Re: Trace length from pin to pin

              John, thank you very much.

              • 4. Re: Trace length from pin to pin


                I'm trying to utilize the script you provided. Must I select a piece of the route, pin, partial route first then invoke the command?

                Is there a report (window and or file) that I should be looking for with this information?



                • 5. Re: Trace length from pin to pin

                  Hi Trini,


                  The script I provided is just one function that calculates the trace length between two pins on a net.


                  You'll need to write the rest of the script, it is up to you how to find which nets to process, which pins on those nets, and how to report the length calculated by the function.



                  • 6. Re: Trace length from pin to pin

                    That's what I was after... pin-to-pin report on a particular routed net. I

                    just don't know if I'm to select the desired trace or pin before I invoke

                    the script.

                    On the same note, whether I need to look for a file that is generated and

                    or simply reported on message window that gave me the info.

                    Thanks Again,







                    From:     john_dube <community_admin@mentor.com>

                    To:     Trini Cantu <trini@raytheon.com>

                    Date:     02/22/2013 02:44 PM

                    Subject:     Re: - Trace length from pin to pin





                    • 7. Re: Trace length from pin to pin

                      In the AutoActiveToolKit there is a script that calculates the trace length actual, manhattan, factor and difference.  It's under the vbs/report folder named ReportNets.efm.  You can borrow the ReportNets function and modify to suit.

                      • 8. Re: Trace length from pin to pin

                        Hello All


                        I have spent some time writing the attached script. It is based on John Dube's example from above. The pinlength_threshold.vbs script scans the design and displays an overview of pincount per net and lets the user specify a pin threshold that the script uses (nets with pincount > Threshold are NOT reported, typically the high-count powernets).


                        As an earlier version I created two other examples for you to play with. In all cases there is no intelligence in which pinpairs are reported (I leave that to the users to code), so even nonexistent pinpairs are reported.

                        pinlength.vbs scans and reports ALL nets in the design (high-count powernets take a loooooong time to report, due to the algorithm explained above)


                        A quicker version is pinlegth_selected.vbs - which lists ALL pinpairs (yes, even nonexistent pinpairs) for a (number of) selected net(s).


                        Enjoy !!