Pages

Your Ad Here

Thursday, 11 November 2010

using NX API

UGS NX is a tool to create and simulate CAD designs.

NX™ programming and customization software tools help companies extend
and tailor NX solution capabilities to their specific needs. Supporting the
knowledge-driven automation capabilities of NX, these tools can be
employed by product development personnel and application developers.
The NX Common Application Programming Interface (API)
NX software provides an automation architecture that serves as the
foundation for all NX APIs as well as for a new journaling utility. Called the
Common API, it combines the power of journaling and automation with the
freedom of a language-neutral platform. Integrated within the core NX
architecture, the Common API is the foundation for all NX solutions and is
fully compatible with the existing Open C API.


NX Open Common Application Programming Interface (API)
The new Common API offers the following features:
• Language support – Provides a native .NET API that supports all .NET languages including Visual Basic .NET and C#. The Java and Open C++ APIs support the full range of Common API capabilities.
• Support for standard integrated development environments (IDEs) – Visual Studio .NET development environment is the industry standard IDE for developing .NET programs. It provides state-of-the-art browsing, editing, debugging, graphical layout of dialogs (WinForms and WebForms) and a unified IDE for web, desktop and mobile development needs. Visual Studio .NET is the recommended IDE for developing NX Open .NET programs. Similarly, Java integrated development environments – Eclipse, etbeans, etc. offer development of platform-independent Java automation programs which may use the JFC/Swing API for interactive user interface. Custom programs using
NX Open for Java API can utilize any of the industry standard Java IDEs forapplication development.


While using NX API, the functionality includes:-

1. First of all, a WPF application is linked to NX. On click of NXOpen button will open NX with the specified plmxml file.

2. Once the NX model is open, to get latest updated expressions, it again goes to .NET code, catches the expressions and update in the model.

Reading a dll into IL file



I went through many blogs and forums when I was required to read a dll and understand if particular string value exists in the dll or not.
I wanted to read dll not for the business logic but for the string value present in dll or not.

Though Ildasm.exe tool is a great help but it tells about the properties and methods in the dll, not about the string value. When you double click on the content in ildasm window then it shows IL (intermediate language).

So now I want to create and read the IL file from this particular DLL.

Code as given below: -

string mSILlocation = "D:\\InterfacingService.il";
string command1 = dllLocation.Insert(dllLocation.Length, mSILlocation).Insert(dllLocation.Length, " /output:");
//string Command = "[DLL Location] /output:[location of new IL file created](file.il)";
int ExitCode;
ProcessStartInfo ProcessInfo;
System.Diagnostics.Process Process;

ProcessInfo = new ProcessStartInfo("C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\bin\\ildasm.exe", command1);
ProcessInfo.CreateNoWindow = true;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit(Timeout);
ExitCode = Process.ExitCode;
Process.Close();