1、NX Open Visual Basic (VB) wizardCreating a Visual Basic project using the NX Open VB wizardThe following topic describes how to develop an NX Open Visual Basic application using Microsoft Visual Studio. It is recommended that all NX Open Visual Basic program development on Windows be done from a Vis
2、ual Basic projectStarting Visual StudioYou can start Visual Studio by typing “devenv.exe“ from an NX command prompt window. Studio will pick up the required NX environment variables necessary to compile and link a project.Creating a Visual Basic projectUse the Visual Basic wizard whenever you need t
3、o create a new NX Open automation program in Visual Studio with the Visual Basic language. The wizard automatically adds the required references to NX Open libraries in the new project.Using the NX Open VB wizardTo use the NX Open VB wizard:Step 1. Select the FileNew Project menu item to activate th
4、e New dialog box.Step 2. Under Project Types, expand Other languages and select Visual Basic.Step 3. Select NX#_VB from the list of Templates (where # is the NX version).Step 4. Enter a project name into the “Project name:“ dynamic input box. By default this becomes the name portion of the program b
5、eing built. For instance, a project named “MyNXOpenApp“ produces either a “MyNXOpenApp.dll“ or “MyNXOpenApp.exe“. You can override this later, if necessary.Step 5. Click OK and follow the on-screen instructions to create your Visual Basic project.NX Open C# wizardCreating a C# project using the NX O
6、pen C# wizardThe following topic describes how to develop an NX Open C# application using Microsoft Visual Studio. It is recommended that all NX Open C# program development on Windows be done from a Visual C# projectStarting Visual StudioYou can start Visual Studio by typing devenv.exefrom the NX Co
7、mmand Prompt window. Visual Studio uses the required NX environment variables to compile and link a project.Creating a Visual C# projectUse the C# wizard whenever you need to create a new NX Open automation program in Visual Studio with the C# language. The wizard automatically adds the required ref
8、erences to NX Open libraries in the new project.Using the NX Open C# wizardTo use the NX Open C# wizard:Step 1. Choose FileNewProject menu item to activate the New dialog box.Step 2. Under Project Types, expand Other languages and select Visual C#.Step 3. From the Templates list. Select NX#_VCS (whe
9、re # is the NX version).Step 4. In Project Name, enter a project name.By default this becomes the name portion of the program being built. For example, a project named MyNXOpenApp produces either a MyNXOpenApp.dll or MyNXOpenApp.exe. You can override this later, if necessary.Step 5. Click OK and fol
10、low the on-screen instructions to create your C# project.Visual Studio Application Wizard SetupMicrosoft Visual Studio can be used to compile, link and debug programs on the Windows platform. There are currently three NX Wizards that have been integrated into Visual Studio and available for use with
11、 the Common API. They are: NX Open Wizard for use with C and C+ programs (found under the VC directory) NX Open VB Wizard for Visual Basic programs (found under the VB directory) NX Open C# Wizard for C# programs (found under the VC# directory)If Visual Studio has been installed on a workstation and
12、 then NX is installed locally (on the same workstation), the available NX Wizards will be installed automatically. Otherwise the following steps need to be taken to set up each of the NX Wizards on the local workstation.Make sure the appropriate version Microsoft Visual Studio has been installed Cop
13、y all files from the NX kit to the corresponding directories of the local Visual Studio installation. The kit is located in: %UGII_BASE_DIR%ugopenvs_filesTo determine the correct location of the Visual Studio installation, look at the productdir registry key for each language. The key for C and C+ i
14、s HKEY_LOCAL_MACHINESOFTWAREMicrosoftVisualStudioversion#SetupVC/productdir (where version# would be 7.1, 8.0, etc). For other languages replace the VC with either VB or VC#. For each wizard, copy any files and/or folders under each subdirectory from the kit to the Visual Studio installation. This e
15、xample is for the C language so substitute VB or VC# and the appropriate subdirectory for the other languages. Copy: %UGII_BASE_DIR%UGOPENvs_filesVCVCWizardstoC:/program FilesMicrosoft Visual Studio 8VCVCWizardsand%UGII_BASE_DIR%UGOPENvs_filesVCvcprojects toC:/program FilesMicrosoft Visual Studio 8VCvcprojects Repeat for each language.