How to understand PartDoc?

Dim swPart                      As SldWorks.PartDoc

Pprovides access to functions that perform part model operations. For example, this object provides functions that allow you to:

  •   create bodies and features. 
  • perform suppress operations.

  • obtain part extents and tessellation.

  • locate entities by name

    Dim swModel                     As SldWorks.ModelDoc2

    Dim swPart                      As SldWorks.PartDoc

   

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swPart = swModel

Application Material method

swPart.SetMaterialPropertyName "SolidWorks Materials.sldmat", "Alloy Steel"

SolidworksApi macros