Thursday, April 14, 2011

Is this A PCB file?

Most of the scripts will be for the PCB editor, so I need to check and make sure when I run a script it's actully being run in a PCB file. Access the PCBServer to get things started.

Sub IsthisaPCBFile

Set Board = PCBServer.GetCurrentPCBBoard
If Board is Nothing Then
     ShowMessage ("This is not a PCB file!")
     ShowMessage ("This is a PCB file!")
End I

End Sub
If a pcb file isn't active in Altium then 
Else if a PCB file is active