PDA

View Full Version : Using VB to select copper pours


Bodhran1
02-28-2006, 04:34 AM
Can anyone tell me what object type I can use to select copper pour outline?

The "HELP" topics in Pads are nearly useless. Is there a better list that explains the PowerPCB.objects types available?


Thanks in advance!

Dave

Tom Frayda
03-07-2006, 10:57 AM
Check out PPCBOle.chm, I think the object type you're after is ppcbDrwCopperPour.


Tom

Bodhran1
05-25-2006, 07:48 AM
Here's what I've got so far......

----------------------------------------------------------------------------------------------------

Sub Main

On Error GoTo EOP

MsgBox "Set your filters to SHAPES and PINS?"

Restart:

MsgBox "Select Net for Copper"
Set objs = ActiveDocument.GetObjects(ppcbObjectTypePin,,True)
For Each mypin In objs
NetName = ActiveDocument.Pins(objs(mypin)).Net.Name

MsgBox "Select Copper Pour or Copper Flood"
Set design = ActiveDocument.GetObjects(ppcbObjectTypeDrawing,, True)
For Each coppertype In design
Select Case coppertype.DrawingType

Case ppcbDrwCopper
MsgBox ("Net " + netname + " assigned to Copper")
'Copy naming function goes here

Case ppcbDrwCopperPour
MsgBox ("Net " + netname + " assigned to CopperPour")
'Copy naming function goes here

Case ppcbDrwCopperHatch
MsgBox "Type: You need to unpour the copper first! Type 'PO', Enter"

End Select
Next Coppertype

Next mypin

GoTo Restart
EOP:

End Sub

-----------------------------------------------------------
I need to add a line at "Copper naming function goes here" that will assign "Netname" to my selected copper or copper pour.

Thanks for your help
Dave

Tom Frayda
09-08-2006, 06:20 AM
Hi Dave-

Sorry for the very delayed reply.

I'd been tinkering with my own version of this kind of script, which I have attached for your viewing pleasure.

However, I hit a wall when it came to assigning a net to a pour outline or a pour outline to a net. I'm not sure that it's possible.

Have you had any success?


Tom

Bodhran1
09-11-2006, 04:18 AM
I hit the same wall.

Work picked up right after I posted, so I haven't re-visited it again since.

I'm not convinced that its impossible, but you know how hard it is to find the right command and then the syntax will baffle me for weeks.

Mentor is no help what so ever when it comes to VB.

Gawd, it would be nice to find someone who knows what commands are buried inside this program!

I haven't given up yet.

We have a new guy starting in a few weeks. Hopefully this will give me some time to spend on scripts.

I'll let you know if I have any luck.

Dave