AnsweredAssumed Answered

delete all via span definitions from the setup parameters

Question asked by barbier_g on Aug 5, 2019
Latest reply on Aug 6, 2019 by barbier_g

Hello all,

 

I would like to delete all via span definitions from the setup parameters with a script but I don't find how to use the method delete of a viaspan object.

 

' Add any type libraries to be used.
Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")

 

' Global variables
Dim pcbAppObj      'Application Object
Dim pcbDocObj      'Document Object

' Get the Application object
Set pcbAppObj = Application

' Get the active document
Set pcbDocObj = pcbAppObj.ActiveDocument

 

Sub DeleteVia()
 Dim viasColl, viaLayerRangeColl, layerRange, pstkObj, viaSpan

 

'Get collection of vias placed on PCB and delete them
 Set viasColl = pcbDocObj.Vias 'Get collection of via
 viasColl.Delete()

 

'Get collection of layerRanges
 Set viaLayerRangeColl = pcbDocObj.SetupParameter.ViaLayerRanges


 For each layerRange in viaLayerRangeColl

'Create again the padstack and via span which already exists in setup Parameters
  Set pstkObj = pcbDocObj.PutPadstack(layerRange.StartLayer, layerRange.EndLayer, layerRange.ViaPadstackName, , True)
  Set viaSpan = pcbDocObj.SetupParameter.PutViaSpan(layerRange.StartLayer, layerRange.EndLayer, pstkObj)

'Delete

 

'Delete the via span to clean up the setup parameter
  viaSpan.Delete()
 Next 

End Sub

 

Thanks in advance for your help.

 

Best regards,

 

Geoffrey

Outcomes