MACRO LIBRARY

Lesson 5.2 start code

Free public access. No account or subscription required.

Files

Lesson 5.2 start code

Code

Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssy As SldWorks.AssemblyDoc
Dim swSelMgr As SldWorks.SelectionMgr
Dim swComp As SldWorks.Component2
Dim swFeat As SldWorks.Feature
Dim strCompName As String
    
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swAssy = swModel
    Set swSelMgr = swModel.SelectionManager
    
    'Get the selected components
    
    'Hide all components
    
    'Show selected components
    
    'Create a new part that consumes the bounded area
    
    'Put new part in new sub-assy
    
    'Show all components
    
End Sub