Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to remove this error Unable to load DLL 'libpart': The specified module could not be found.

Status
Not open for further replies.

dhaval082

Mechanical
Jun 24, 2013
26
i have use this code
using System;
using NXOpen;
using NXOpen.UF;
using System.Runtime.InteropServices;

public class Program
{
// class members
private static Session theSession;
private static UFSession theUfSession;
public static Program theProgram;
public static bool isDisposeCalled;

//------------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------------
public Program()
{
try
{

theSession = Session.GetSession();
theUfSession = UFSession.GetUFSession();
isDisposeCalled = false;


//code
//Session theSession = Session.GetSession();
Part workPart = theSession.Parts.Work;
Part displayPart = theSession.Parts.Display;
// ----------------------------------------------
// Menu: File->Close->Save As and Close...
// ----------------------------------------------
PartSaveStatus partSaveStatus1;
partSaveStatus1 = workPart.SaveAs("C:\\Users\\Dhaval\\Desktop\\PISTON_9HSE_411_2");

partSaveStatus1.Dispose();
workPart.Close(NXOpen.BasePart.CloseWholeTree.True, NXOpen.BasePart.CloseModified.DontCloseModified, null);

workPart = null;
displayPart = null;


}
catch (NXOpen.NXException ex)
{
// ---- Enter your exception handling code here -----
// UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.Error, ex.Message);
}
}

//------------------------------------------------------------------------------
// Explicit Activation
// This entry point is used to activate the application explicitly
//------------------------------------------------------------------------------
public static int Main(string[] args)
{
int retValue = 0;
try
{
theProgram = new Program();

//TODO: Add your application code here

theProgram.Dispose();
}
catch (NXOpen.NXException ex)
{
// ---- Enter your exception handling code here -----

}
return retValue;
}

//------------------------------------------------------------------------------
// Following method disposes all the class members
//------------------------------------------------------------------------------
public void Dispose()
{
try
{
if (isDisposeCalled == false)
{
//TODO: Add your application code here
}
isDisposeCalled = true;
}
catch (NXOpen.NXException ex)
{
// ---- Enter your exception handling code here -----

}
}

}



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor