×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VB Code Options? Lists?

VB Code Options? Lists?

VB Code Options? Lists?

(OP)
I am not sure of the correct way to word this. When you start a journal, you have the Imports at the top. For example, you might have Imports NXOpen.

Is there anyplace one can go to find a list of all the options that might be used with NXOpen? As well as other Import functions?

RE: VB Code Options? Lists?

Just search 'journal' in this forum
and you will find many examples.

RE: VB Code Options? Lists?

(OP)
But wouldnt that only give me examples of the ones used here so far? Couldnt there be plenty of uses in NXOpen that are not used in this forum yet? And if they are used, that can be very difficult to scroll through pages and pages of posts in this forum when often the headlines dont fully explain what are in the posts. Is there not some kind of list created for everything you can use with NXOpen?

In all honesty, this is not for me. Another gentleman here is trying to create code and was frustrated that he couldnt find any kind of list of uses. I am such an amateur with code that I am only relaying what I believe he is looking for because I have been on here for my own help so much. He understands it more than I do but even he is pretty much self taught and still learning it. So if my question doesnt make full sense this is why.

For example, I am right now trying to manipulate some code to simply open "Information Object" and set the filter to "Point". Then just let the operator select a couple points and hit OK and it will give him the information window with everything on that point. This is easy enough to do without code, I know, but we have a group here that does it so much that it would save them the hassle of having to go in and set the filter every time. One click on a button, select your points, and hit OK. The problem is the code I have to manipulate was for selecting a cylindrical face and would automatically add specific attributes to the face. I have spent hours trying to make changes and get it to work but I get some kind of error every time. It would be so much easier if there were some lists out there that one could look up and see what functions or whatever they need to use or can use with different areas in the code. ..... I am sure you are probably chuckling by now at my terminology and how lost I seem. lol

Then once I get this code figured out, I have to manipulate that to select solid bodies. Which will be easier because at least the code will be using the same functions this time and just selecting different types.

RE: VB Code Options? Lists?

The NXOpen .NET Reference shows the different packages to enable you to work out which Import statements you need.

Mike Hyde
www.astonmartin.com
NX12.0.0 with TC11.3 and Vis 11.3

RE: VB Code Options? Lists?

When writing code, it is very common to make use of code that someone else has written. Assuming that I have an NX .net author license, I can open my code project and add a reference to other code such as Excel or windows media player and make use of the functionality it provides. After I add a reference, I can add an "imports" statement to my code to make those external objects easier to access. For instance, I often make use of List objects in my code. The list object is provided by the .net framework; in the .net library hierarchy, it is a System.Collections.Generic.List object. If my code imports the System namespace, I would declare a new list like so:

CODE

Imports System

dim myList as New Collections.Generic.List(of String) 

However, I can shorten that if I import the System.Collections.Generic namespace:

CODE

Imports System
Imports System.Collections.Generic

dim myList as New List(of String) 

The imports statement does not create the reference, it simply gives you an alias to make the code easier to read and write. If you do not have an NX author license and you are writing journals, NX will automatically link you to some of the .net libraries. You will be limited to those libraries and cannot add references to others. The ones you have access to can be found here (near the bottom of the page).

If you are looking specifically for NXOpen functionality, check out the .net reference guide. It lists all the objects and functions that the NXOpen API gives you access to. However, there is no single, comprehensive list of ALL other code that you could possibly link to (it would be huge, and much would not be relevant to use with NX).

Here is a few links about references and the imports statement:
https://docs.microsoft.com/en-us/dotnet/visual-bas...
https://docs.microsoft.com/en-us/dotnet/visual-bas...

www.nxjournaling.com

RE: VB Code Options? Lists?

(OP)
Thank you both of you. Hopefully this is what he is looking for. I know I am going to learn what I can from this info myself.

RE: VB Code Options? Lists?

The question is hard to answer. On the one hand you can import any namespace or class that's in a library referenced by your project. So, if your project has a reference to NXOpen, then you can import any namespace or class in NXOpen. There are hundreds of them. They're listed in the NXOpen Reference Guide. Same with the SNAP Reference Guide.

On the other hand, you don't actually need to import anything. The import facility just lets you use shorter names. You can always type the full (long) names instead, if you want to. In fact some people recommend coding this way, since it makes it completely clear what functions are being called.

There is a simple explanation of this stuff in the "Getting Started with SNAP" guide that ships with NX. In fact, there is whole chapter that covers the basics of the VB language.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close