1 of 1 people found this helpful
I can't say I know how to do this off the top of my head, but I think Automation can handle this. You probably want to check the PADS Layout Command Reference Manual but I can see some code snippets suggesting this would be possible. The Pin.TestPoint page gives the following code snippet, which removes all test points from the design and then adds one top layer test point per net on an arbitrary pin:
' Remove all test points
For Each nextPin In ActiveDocument.Pins
nextPin.TestPoint = ppcbTestPointNone
' Add one top layer test point per net
For Each nextNet In ActiveDocument.Nets
Set arbitPin = nextNet.Pins.Item(0)
arbitPin.TestPoint = ppcbTestPointTopLayer
There is also Report Generation Language (RGL) syntax described which can report the (X,Y) location of pin & via test points, whether a net has a test point assigned, the total number of test points, etc. See the file Test Points.BAS mentioned in the document. This may be handy to check the test point locations against your ASCII list if you do end up adding them manually.
Perhaps you can add vias by (X,Y) coordinate and then set the via type to test point with the PPcbTestPointType command?
Your idea of using the Layout Basic Script tool was intriguing to me, so I took a couple of days to get a script together, and I was able to successfully run a script to do exactly what I wanted. Thanks for your suggestion.
Hi Gabe. I'm moving this thread to the PADS layout community where other people will be able to find it more easily. If you're willing to share your script with other PADS customers, please post it in our scripting community, Scripting . Thanks!
Gabe, I know you solved your problem but I am curious how you added vias.
I wanted a script to add test point vias similar to the test point option and had a devil of a time figuring out how to do it. I searched for a net.via.add function but to no avail.
This is the result which you may find useful for the addvia portion. This simple script adds unrouted test point vias at 0,0 for nets that don't have any vias or pins designated as test points. The only issue I would see as a hurdle is the fact that adding a via references a net in the current design and Pads requires a minimum of two points to assign a net. If your second board uses the same netnames then you could just read the xy and netname from the first board, save the info to a file, load the second board and add the via to the second board using the saved XY and netname with a different script.
If you aren't sure if the netnames are used in the second board, what you could do is this:
Option A- add one dummy part and a single pin tp part for each net, locate the tp part to the same location as the top board test point using the file and add a net from it to the dummy part or B: add two dummy parts, add a net from the list between the two and add a via at the XY. It depends on what you ultimately want at your tp location, a single pin part or via. In either case, I would think you want a pad or via tied to the same net at the same location.
1-Read the test point locations from the top board and save the netnames and tp xy locations to a file.
2- Create your second board outline and make sure the board 0,0 is in the same location as the top board. You could import the ascii for the second board at this point, but park everything off board to remove clutter.
3- create a dummy part with enough pins to accommodate every tp you need. Control the ref des ie:XTP1
Option A- Going through the file, add a single pin part to the board, incrementing the ref des as you go. XP1, XP2 etc. Read the net from the list and add it to the test point part and the dummy part pin with the same number. If the net exists in the parts you already ascii'd in, it will tie. If not, the net will only run from the test point to the dummy part. Later, when you delete the dummy part, Pads will flag any nets that are removed as a check and leave the test point part without a net, but hold the place on the second board so you don't route through it.
Option B- Add two dummy parts and park both outside the board area. Control the ref des ie:XTP1and XTP2 and add two of them to the board, both outside the board outline. (will be deleted later)
4- using the saved info, add the net to the same pin on both dummy parts and then add a test via to the same xy as the top board. If the net is already used in the startup circuitry, it will tie to it. If not, then both dummy parts give the minimum two pins to support the via.
If you choose the via option, the Add Free Via command isn't picky about the via name, but there must be at least one via available to each net. If you change the xy of the added via make sure the line printed to the macro matches exactly the Complete Move line
'Dim tpcount as integer
Open "c:\temp\mymacro2.mcr" For Output As #1
Print #1, "Macro Macro1"
Set nets = ActiveDocument.Nets
If Sorted Then nets.Sort
For Each aNet In nets
tpcount = 0
Set pins = aNet.Pins
If Sorted Then pins.Sort
For Each aPin In pins
If aPin.TestPoint <> ppcbTestPointNone Then goto addok
Set vias = aNet.Vias
If Sorted Then vias.Sort
For Each aVia In vias
If aVia.TestPoint <> ppcbTestPointNone Then goto addok
Print #1, "Application.ExecuteCommand(""Find"")"
Print #1, "FindDlg.FindBy = ""Nets""
Print #1, "FindDlg.Value = " & Chr$(34) & aNet.Name & Chr$(34)
Print #1, "FindDlg.Ok.Click()
Print #1, "Application.ExecuteCommand(""Add Free Via"")
Print #1, "DlgYesNoCheckQuestion.Question(""Adding shielding or stitching vias with DRC not in Prevent mode may result in clearance violations.Do you want to continue?"").Answer(mbYes)"
Print #1, "Application.ExecuteCommand(""Complete Move"", 0mil,0mil)"
Print #1, "Application.ExecuteCommand(""Cancel"")"
Good luck. Let me know how it turns out