AnsweredAssumed Answered

Advanced Component Selection vba macro

Question asked by Frank Wu Frank Wu on Oct 25, 2016
Latest reply on Oct 26, 2016 by Frank Wu Frank Wu

Does anyone know how to load a .xml external search file of Advanced Component Selection and run it by using the vba macro?

 

 

 

11.bmp

 

REF Code

 

Dim swApp               As SldWorks.SldWorks

Dim boolstatus          As Boolean

Dim swModel             As SldWorks.ModelDoc2

Dim swAssy              As SldWorks.AssemblyDoc

Dim swASC               As SldWorks.AdvancedSelectionCriteria

Sub Main()

Set swApp = Application.SldWorks

Set swModel = swApp.ActiveDoc

Set swAssy = swModel

Set swASC = swAssy.GetAdvancedSelection

boolstatus = swASC.LoadCriteria("C:\Query.xml")

swASC.Select

End Sub

Outcomes