# 본 게시글의 위치를 "PCB Design and Scripting"이 아닌 한단계 하위의 "Automation Scripting"로 이동 부탁드립니다
올려주신 구문은 사실상 선택한 핀과 상관없이 design상의 모든 component에 대해 popup이 발생할 수 있습니다.
아래와 같이 selection event가 발생했을시,
현재 선택된 핀에 대해,
"colPins = pcbDoc.Pins(1) "
핀이 속한 부품을 찾아서,
"oComp = oPin.Component"
부품이 특정 part number일 경우 MsgBox를 표시하도록 예제를 수정하였습니다.
" If oComp.PartNumber = "1203-007904" Then"
아래 Sub function 구문을 그대로 사용해보시기 바랍니다.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Sub pcbDoc_OnSelectionChange(enumSelectionType)
Dim colPins, oPin, colComps, oComp
Set colPins = pcbDoc.Pins(1)
If colPins.count = 0 Then
'MsgBox "No pin selected"
ElseIf colPins.count = 1 Then
For Each oPin in colPins
Set oComp = oPin.Component
If oComp.PartNumber = "1203-007904" Then
MsgBox "Pin Number: " & oPin.Name & vbCrlf & "Ref: " & oComp.Name & vbCrlf & "Cell: " & oComp.CellName & vbCrlf &_
"Part Number: " & oComp.PartNumber & vbCrlf &_
"1. Connect the VOS line(14 Pin) in the shortest way to VOUT line(14 Pin) at the output capacitor" & vbcrlf &_
"2. To avoid noise coupling into the VOS line(14 Pin), this connection should be separated from the VOUT power line/plane" & vbcrlf &_
"3. Sensitive nodes like FB Line(5 pin) should be connected with short wires(Pland"
End If
Next
Else
MsgBox "More than 2 pins are selected"
End If
Set colPins = Nothing
End Sub
---------------------------------------------------------------------------------------------------------------------------------------------------------