Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Call Vb to run journal file recorded in NX7.5

Status
Not open for further replies.

Nelson1003

Mechanical
Jan 24, 2016
1
Hi, I am a design engineer for plastic mold. I know the basics of visual basic programming and not very much understand NX7.5 syntax. I actually started to create a component library for my design work use. I created one interface using visual basic in visual studio 2008 and there i can customize the size i want for my design. I recorded a journal file so that i can modify it and generate a new model. But is there any function to call out to run the journal file i recorded?
For my logical thinking, I would like to have my sequence to run like this:
1. Execute the .exe file in NX by File-->Execute-->NX Open
2. Opening the interface i have created, change the size to what i want and one button to generate
3. By generating, it will flow to the journal file i recorded earlier on and modify the value to the value I just set and NX7.5 will run the journal to create the model.
Please let me know if my sequence will work in NX7.5 and if it's correct, how to ask NX7.5 to run the journal by itself?
Thank you very much in advance.

Nelson
 
Replies continue below

Recommended for you

Nelson,

Here's the basic steps to run a Visual Studio NX journal:

- Build a .dll, not an .exe.
- To run from (interactive) NX use Ctrl-U and select your dll.

If you start from one of the Visual Studio NX Open Wizards project templates then the VS project will be correctly set up and you can drop your code. Recording is a good way to get most of the code you need.

Also in you project properties under Debug set "Start external program" to "C:\Program Files\Siemens\NX 10.0\UGII\ugraf.ex" (or your path) and then when you click start it will launch NX with the debugger attached.

From the NX Help home page look at Programming Tools for more background.

Paul



Paul Turner
CAD & Process Engineer
Mastip Technology
 
> Build a .dll, not an .exe.

It doesn't matter whether you build a DLL or EXE. And, in fact, in the .NET world, there's not much difference between the two.

> Recording is a good way to get most of the code you need.

Not so sure about that. I think recording is a good way to find out what functions you need to call, but the recorded code is pretty horrible, in my view, and I wouldn't want it in any app that I write.

Another good source of info for beginners is the "Getting Started with SNAP" guide. Even if you're not going to be using SNAP functions, the basic background and logistics info is still relevant and useful, IMO.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor