Option Explicit
Dim pcbApp
Set pcbApp = GetObject(,"MGCPCB.ExpeditionPCBApplication")
Dim pcbDoc
Set pcbDoc = pcbApp.ActiveDocument
If (ValidateServer(pcbDoc) = 1) Then
Call Scripting.AttachEvents(pcbDoc, "pcbDoc")
Scripting.DontExit = True
End if
Sub pcbDoc_OnSelectionChange(enumSelectionType)
Dim colComps, oComp, i, myArray()
Set colComps = pcbDoc.Components(epcbSelectAll)
ReDim myArray(colComps.count-1)
For i=1 to colComps.count
myArray(i-1) = colComps.item(i).partnumber
'msgbox myArray(i-1)
Dim colPins, oPin
Set colPins = pcbDoc.Pins(1)
If colPins.count = 1 Then
If myArray(i-1) = "1203-007904" Then
MsgBox " 1. Connect the VOS line(14 Pin) in the shortest way to VOUT line(14 Pin) at the output capacitor" & vbcrlf & vbcrlf & _
"2. To avoid noise coupling into the VOS line(14 Pin), this connection should be separated from the VOUT power line/plane" & vbcrlf & vbcrlf & _
"3. Sensitive nodes like FB Line(5 pin) should be connected with short wires(Pland "
End If
End If
Next
End Sub
Private Function ValidateServer(doc)
Dim key, licenseServer, licenseToken
key = doc.Validate(0)
Set licenseServer = CreateObject("MGCPCBAutomationLicensing.Application")
licenseToken = licenseServer.GetToken(key)
Set licenseServer = nothing
On Error Resume Next
Err.Clear
doc.Validate(licenseToken)
If Err Then
ValidateServer = 0
Else
ValidateServer = 1
End If
End Function