Get Build Numbers Example (C#)
This example shows how to get the build, major revision, and hot fix numbers
of the SolidWorks application.
//----------------------------------------------------------------------------
// Preconditions: Open Solidworks.
//
// Postconditions: Inspect the Immediate window for build, major revision,
// and hot fix numbers.
//----------------------------------------------------------------------------
using
Microsoft.VisualBasic;
using
System;
using
System.Collections;
using
System.Collections.Generic;
using
System.Data;
using
System.Diagnostics;
using
SolidWorks.Interop.sldworks;
using
SolidWorks.Interop.swconst;
namespace
GetBuildNumbers2_CSharp.csproj
{
partial
class
SolidWorksMacro
{
string
BaseVersion;
string
CurrentVersion;
string
HotFixes;
public
void Main()
{
swApp.GetBuildNumbers2(out
BaseVersion, out
CurrentVersion, out
HotFixes);
Debug.Print("SolidWorks
major revision number: " + BaseVersion);
Debug.Print("SolidWorks
build number: " + CurrentVersion);
Debug.Print("SolidWorks
hot fix numbers: " + HotFixes);
}
public
SldWorks
swApp;
}
}