Writing a SOLIDWORKS Sustainability API application typically involves:
- Adding a reference to either the SOLIDWORKS Sustainability API type library or primary interop assembly:
- VBA: sustainability version Type Library or install_dir\sustainability.tlb.
- C# or VB.NET: SOLIDWORKS.Interop.sustainability or install_dir\api\redist\CLR2\SOLIDWORKS.Interop.sustainability.dll.
NOTE: install_dir is typically C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS.
- Opening a part or assembly document.
- Getting the model document object, IModelDoc2.
- Calling IModelDocExtension::GetSustainability to get the entry point to the SOLIDWORKS Sustainability API, ISustainabilityApp.
- Getting and setting environmental impact factors:
- Specifying the amount of product use time over which to evaluate environmental impact.
- Specifying the units of time over which to evaluate environmental impact.
- Updating the environmental impact results.
- Obtaining the environmental impact of a part or assembly in terms of air acidification, carbon footprint, energy consumption, and water eutrophication.
For more information about SOLIDWORKS Sustainability, see the SOLIDWORKS Help.