MACRO LIBRARY

Update config listed in external references of inserted part feature

Free public access. No account or subscription required.

Files

Update configuration listed in external references of inserted part feature

Code

Module: mMain

'Demonstrates how to update the configuration listed in the external references of an _
    inserted part feature.
    
'Preconditions:
'1. Configuration name is specified in CONFIG_NAME constant.
'2. Part is open, inserted part is selected, and the model of that inserted part is also open.
    
'Note: The inserted part
    
'Written by Keith Rice
'CADSharp LLC
'www.cadsharp.com
    
Const CONFIG_NAME As String = "Default"
    
Sub main()
    Dim swApp As SldWorks.SldWorks
    Dim swModel As ModelDoc2
    Dim swSelMgr As SelectionMgr
    Dim swFeat As Feature
    
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swSelMgr = swModel.SelectionManager
    Set swFeat = swSelMgr.GetSelectedObject6(1, -1)
    swFeat.UpdateExternalFileReferences swExternalFileReferencesNamedConfig, CONFIG_NAME, Empty
End Sub