Learning to program in NX using VB
Learning to program in NX using VB
(OP)
I was wondering if I could get some help creating a specific program. I feel like all the pieces to this experimental project are there I just don’t understand how to put it all together.
As a disclaimer I am still learning how to program in vb and python so I am not as skilled as I would like to be, so if you know of any good books or tutorials that can teach me how to program for NX in VB please let me know!
Ideally what I want is a program that I can run after I have finished modeling a part and the program will go down the NX model history tree and read the model history and save out to a text file the steps used to create the part including the information found within the sketches, essentially what journal feature does when you record the creation of a part. So that later on I can create a vb form and attach the text to a button and when the vb exe is run within NX I can press that button and it will create that part in NX. I can see that if I record a journal that what I want kind of already exists in NX. Journals already records how a part is made and NX lets you replay the journal to recreate a part, so I feel like all the pieces to my experimental project are there I just don’t understand how to put it all together.
Can anyone help?
As a disclaimer I am still learning how to program in vb and python so I am not as skilled as I would like to be, so if you know of any good books or tutorials that can teach me how to program for NX in VB please let me know!
Ideally what I want is a program that I can run after I have finished modeling a part and the program will go down the NX model history tree and read the model history and save out to a text file the steps used to create the part including the information found within the sketches, essentially what journal feature does when you record the creation of a part. So that later on I can create a vb form and attach the text to a button and when the vb exe is run within NX I can press that button and it will create that part in NX. I can see that if I record a journal that what I want kind of already exists in NX. Journals already records how a part is made and NX lets you replay the journal to recreate a part, so I feel like all the pieces to my experimental project are there I just don’t understand how to put it all together.
Can anyone help?





RE: Learning to program in NX using VB
It does seem possible to make a journal to do what your saying, but NX has modeling tools that are probably better suited.
RE: Learning to program in NX using VB
Presumably your form will be used to change some of the creation parameters?
If the changes you're going to have users make to the inputs are just parametric changes (different expression values, for instance) then a tool like Product Template Studio can help you wrap a nice NX-style block dialog user interface around any part or assembly without doing any coding at all.
On the other hand, if you're just experimenting to see what you can do with VB, then by all means, record a Journal of your operations, and then slap on a VB form.
I would concur that http://www.nxjournaling.com/ is a great resource for getting started. In your case, you might look particularly at:
"Using WinForms in Journals"
http://www.nxjournaling.com/content/using-winforms-journals
"User input: input boxes"
http://www.nxjournaling.com/content/user-input-input-boxes
and
"Start journal from custom button"
http://www.nxjournaling.com/content/start-journal-custom-button
Good luck!
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)