Save as De-Featured File Example (C#)
This example shows how to de-feature an assembly and save it as a part.
// -----------------------------------------------------------------------------
// Preconditions: Open:
// <SOLIDWORKS_install_dir>\samples\tutorial\cosmosfloxpress\ball valve\ball_valve.sldasm.
//
// Postconditions: The
de-featured assembly is saved as a part.
// ------------------------------------------------------------------------------
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System;
namespace SaveFileAsDeFeaturedPart_CSharp.csproj
{
partial
class SolidWorksMacro
{
ModelDoc2
Part;
bool
boolstatus;
public
void Main()
{
Part
= (ModelDoc2)swApp.ActiveDoc;
boolstatus
= Part.Extension.SaveDeFeaturedFile("C:\\temp\\ball_valve.sldprt");
}
public
SldWorks swApp;
}
}