1 of 1 people found this helpful
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
TraceLength = dLen
John, thank you very much. This is just what I need. Surprisingly, I haven't noticed such method earlier.
John, thank you very much.
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?
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.
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
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.
From: john_dube <firstname.lastname@example.org>
To: Trini Cantu <email@example.com>
Date: 02/22/2013 02:44 PM
graycol.gif 105 bytes
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.
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).