API: How to get the parent component of a selected assembly component (VBA, VB.NET, C#)

Version 4

    This example shows how to get the parent component of a selected assembly component.

     

    1. Download and extract the archive in a convenient location.
    2. Open an assembly in SolidWorks.
    3. Select a child component in the assembly view.
    4. Open an Immediate window.
    5. Run the macro (VBA, VB.NET, or C#) in the Macro Editor.

     

    The Immediate window displays the names of the selected child component and its parent.

     

    Note:
    - Subscription Services required for full access.

    - Looking for more API Examples?

     

    Copyright © 2011 Dassault Systèmes SolidWorks Corp. All rights reserved.
    Do not distribute or reproduce without the written consent of Dassault Systèmes SolidWorks Corp.