AnsweredAssumed Answered

Query method not working

Question asked by zachs1997 on Jun 14, 2019
Latest reply on Jun 17, 2019 by varunk



I'm currently trying to query a schematic for a certain reference designator and then changing the model/spicefile path of the component, but (I assume) my code isn't matching the components with the refdes string I'm comparing it with. I get no errors running this so I'm at a loss for what to do.


Sub modify_comp(refD, model)
 Dim objApp, oComp, oAttr
 Set objApp = GetObject(,"ViewDraw.Application")
 For Each oComp In objApp.Query(VDM_COMP, VD_ALL)
  If oComp.REFDES Is refD Then
   Set oAttr = oComp.FindAttribute("Model")
   oAttr.Value = model
   oComp.selected = true
  End If
End Sub


Any help would be appreciated.