API: How to create a drawing of a flattened sheet metal part (VBA, VB.NET, C#)

Version 4

    This example shows how to create a drawing of a flattened sheet metal part.

     

    Problem statement:

     

    The drawing view must be of the part in its flattened state and without bend lines. This ensures that the export to DXF is suitable for subsequent import into laser cutting software that normally only requires the outline of the profile to be cut.

     

    Solution:

     

    Placing a flattened view honors the application-level setting related to
    display of tangent edges. Set this to hidden before creating the flattened view.

     

    Tools > Options > Drawings > DefaultDisplayType > Default display of tangent edges in new drawing view

     

    The display of both model and drawing origins must be turned off, otherwise some *very* small lines representing the axes will be included in the DXF export:

     

    View -> Origins

     

    1. Extract the archive to a convenient location.
    2. Open a sheet metal part in SolidWorks.
    3. Unsuppress the flattened pattern.
    4. Open the macro (VBA, VB.NET, C#) in the Macro Editor.
    5. Run the macro.

     

    A new A1-sized drawing is generated with a flattened view of the sheet metal part and no bend lines showing.

     

    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.