Hide Table of Contents
Getting Started

Glossary Item Box

Writing a SolidWorks Costing API application typically involves:

  1. Adding a reference to either the SolidWorks Costing API type library or primary interop assembly:
    • VBA: SldCostingAPI version Type Library or install_dir\sldcostingapi.tlb.
    • C# or VB.NET: SolidWorks.Interop.sldcostingapi or install_dir\api\redist\CLR2\SolidWorks.Interop.sldcostingapi.dll.

      NOTE: install_dir is typically C:\Program Files\SolidWorks Corp\SolidWorks.
  2. Opening a sheet metal or machining part.
  3. Getting or setting the Costing template folders and Costing Report template folders using ISldWorks::GetUserPreferenceStringValue or ISldWorks::SetUserPreferenceStringValue (see Templates).
  4. Getting the model document, IModelDoc2 object.
  5. Getting the CostingManager, ICostManager object, and getting the Costing templates.
  6. Getting the Costing model, ICostPart object.
  7. Creating or getting the common Costing analysis, ICostAnalysis object, and getting and setting its analysis data.
  8. Getting the Costing bodies, ICostBody objects.
  9. Creating or getting each Costing body's: 
  10. Getting each Costing feature or subfeature, ICostFeature object, and getting or setting its analysis data.


The SolidWorks Costing tool provides templates that associate manufacturing features with their costs. The templates include information about material, machining, and labor costs. After the manufacturing features are recognized, Costing categorizes each manufacturing feature and applies the correct information from the template to cost out the specific manufacturing features. A total cost for all of the features is tabulated and a final unit cost is returned. You can also create reports of Costing results using the SolidWorks Costing tool. The detailed line items in the report help you determine the impact of design decisions on cost.

To get or set the file locations for Costing templates and Costing report templates, you can use the SolidWorks API and call ISldWorks::GetUserPreferenceStringValue or ISldWorks::SetUserPreferenceStringValue with:

For more information about SolidWorks Costing and its templates, see the SolidWorks Help.

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   Getting Started
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2013 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.