Example: biology

Getting Started with NXOpen - Siemens

Unrestricted Getting Started with NX Open Update January 2019 2019 Siemens Product Lifecycle Management Software Inc. All rights reserved. Unrestricted Table of Contents Chapter 1: Introduction .. 1 What Is NX Open .. 1 Purpose of this Guide .. 1 Where To Go From Here .. 1 Other Documentation .. 2 Example Code .. 3 Chapter 2: Using the NX Journal Editor .. 4 System Requirement The .NET Framework .. 4 Typographic Conventions .. 4 Licensing .. 4 The Guide Functions .. 5 Example 1: Hello World .. 5 Example 2: Collections .. 6 Example 3: Creating Simple Geometry .. 8 Example 4: Reading Attributes .. 9 Example 5: WinForms (The Hard Way) .. 11 What Next? .. 14 Chapter 3: Using Visual Studio Express .. 15 Installing Visual Studio.

C:\Program Files\Siemens\NX 12, or something similar. The example programs accessing NX Open UI APIs are only applicable for Windows platforms. We will refer to user create files for Visual Studio, specifically Project and Templates. The path to …

Tags:

  User, With, Getting, Started, Siemens, Getting started with

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Getting Started with NXOpen - Siemens

1 Unrestricted Getting Started with NX Open Update January 2019 2019 Siemens Product Lifecycle Management Software Inc. All rights reserved. Unrestricted Table of Contents Chapter 1: Introduction .. 1 What Is NX Open .. 1 Purpose of this Guide .. 1 Where To Go From Here .. 1 Other Documentation .. 2 Example Code .. 3 Chapter 2: Using the NX Journal Editor .. 4 System Requirement The .NET Framework .. 4 Typographic Conventions .. 4 Licensing .. 4 The Guide Functions .. 5 Example 1: Hello World .. 5 Example 2: Collections .. 6 Example 3: Creating Simple Geometry .. 8 Example 4: Reading Attributes .. 9 Example 5: WinForms (The Hard Way) .. 11 What Next? .. 14 Chapter 3: Using Visual Studio Express .. 15 Installing Visual Studio.

2 15 Installing NX Open Templates .. 16 Licensing Issues Again .. 16 Example 1: Hello World Again .. 16 Example 2: Declaring Variables .. 19 Example 3: WinForms Again .. 20 Example 4: Hello World Yet Again (the Hard Way) .. 23 Example 5: Editing a Recorded Journal .. 25 Debugging in Visual Studio .. 28 Chapter 4: The Visual Basic Language .. 29 The Development Process .. 29 Structure of a Visual Basic 29 An Example Program .. 30 Lines of Code .. 31 Built-In Data Types .. 32 Declaring and Initializing Variables .. 32 Omitting Variable Declarations .. 33 Data Type Conversions .. 34 Arithmetic and Math .. 34 Logical Values & 35 Arrays .. 35 Other Types of Collections .. 36 36 Enumerations .. 37 37 Decision Statements .. 38 Looping.

3 38 Functions and Subroutines .. 39 Classes .. 40 Shared Functions .. 41 Object Properties .. 41 Hierarchy & Inheritance .. 42 Chapter 5: Concepts & Architecture .. 43 The Levels of NX Open .. 43 More About .. 43 The NX Open Inheritance Hierarchy .. 44 Sessions and Parts .. 44 Objects and Tags .. 45 Factory Objects .. 46 Object Collections .. 47 The Builder Pattern .. 47 Exploring NX Open By Journaling .. 49 The FindObject Problem .. 49 Mixing SNAP and NX Open .. 50 Chapter 6: Positions, Vectors, and Points .. 52 Point3d Objects .. 52 Vector3d Objects .. 53 Points .. 53 Chapter 7: Curves .. 55 Lines .. 55 Associative Line Features .. 55 Arcs and Circles .. 56 Associative Arc Features .. 58 Conic Section Curves .. 59 Splines.

4 59 Studio Splines .. 61 Sketches .. 62 Chapter 8: Simple Solids and Sheets .. 64 Creating Primitive Solids .. 64 Sections .. 65 Extruded Bodies .. 67 Revolved Bodies .. 68 Chapter 9: Object Properties & Methods .. 69 NXObject Properties .. 69 Curve and Edge Properties .. 71 Face Properties .. 74 Chapter 10: Feature Concepts .. 76 What is a Feature ? .. 76 Types of Features .. 76 Feature Display Properties .. 77 Using Features and Bodies .. 78 Units .. 78 Expressions .. 79 Creating Expressions .. 81 Using Expressions to Define Features .. 82 Chapter 11: Assemblies .. 84 Introduction .. 84 The Obligatory Car Example .. 84 Trees, Roots, and Leaves .. 84 Components and Prototypes .. 85 Cycling Through An Assembly .. 87 Indented 88 Component Positions & Orientations.

5 88 Object Occurrences .. 89 Creating an Assembly .. 91 More Advanced Positioning .. 93 Changing Reference Sets .. 95 Other Topics .. 95 Chapter 12: Drawings & Annotations .. 97 97 Dimensions .. 98 Notes .. 99 Chapter 13: 100 Cycling Through CAM Editing CAM Objects ..101 CAM Views ..102 Creating a Tool ..103 Chapter 14: Block-Based Dialogs .. 104 When to Use Block-Based Dialogs ..104 How Block-Based Dialogs Work ..105 The Overall Using Block UI Styler ..106 Template Code ..107 The initialize_cb and dialogShown_cb Event Handlers ..108 The apply_cb Event Handler ..108 The update_cb Event Handler ..110 Callback Details ..111 Precedence of Values ..111 Getting More Information ..112 Chapter 15: Selecting NX Objects .. 113 Selection Dialogs.

6 113 SelectObject Blocks ..118 Selecting Faces, Curves and Edges using Collectors ..120 Selection by Database Cycling ..122 Chapter 16: Exceptions .. 124 Exceptions ..124 Example: Unhandled Exceptions ..125 Handling an Exception ..126 Exception Properties ..127 NX Exceptions ..127 Using Undo for Error Recovery ..128 Avoiding Exceptions ..128 The Finally Block ..129 Chapter 17: Troubleshooting .. 130 Using the NX Log File ..130 Invalid Attempt to Load Library ..130 XXX is not a member of NXOpen ..131 Unable to Load Referenced Library ..132 Visual Studio Templates Missing ..132 Failed to Load Unrestricted Getting Started with NX Open Chapter 1: Introduction Page 1 Chapter 1: Introduction What Is NX Open NX Open is an Application Programming Interface (API) that lets you write programs to customize or extend NX.

7 The benefit is that applications created this way can often speed up repetitive tasks, and capture important design process knowledge. There is a broad range of NX Open functions, which provide capabilities like Creating part geometry, assemblies, drawings, and CAE and CAM objects Cycling through the objects in a part file, reading information or performing various operations on them Creating custom user interfaces that allow users to select objects and enter data Some typical applications of these functions are: Creating part geometry or drawings according to your local standards Importing data from other sources, outside of NX Reading data from objects in a part file, and writing it out in some form of report Building custom applications to make processes faster or easier to understand Of course, these are just a few examples of what is possible.

8 You can probably think of many little repetitive processes that you would like to automate to speed up your work or standardize your output. If you d like a little more background information, please continue reading here. If you can t wait, and you just want to start writing code immediately, please skip to chapter 2, where we show you how to proceed. Purpose of this Guide This guide is a beginner s introduction to programming using NX Open. It will get you Started in writing your first few applications, and give you a sample of some of the things that are possible with NX Open. You don t need to have any programming experience to read this document, but we assume you have some basic knowledge of NX and Windows. If you are an experienced programmer, the only benefits of this document will be the descriptions of programming techniques specific to NX.

9 The variant of NX Open that we re describing here is just a .NET library, so it can be used with any .NET-compliant language. In this document, we focus on the Visual Basic (VB) language, but in most cases it will be obvious how to apply the same techniques in other .NET languages, such as C#, IronPython, F#, etc. Other versions of NX Open are available for use with C++, Java, and Python. Where To Go From Here The next two chapters show you how to write programs in two different environments. If you have no programming experience, you won't understand much of the code you see. That s OK the purpose of these two chapters is to teach you about the programming environments and their capabilities, not about the code. Chapter 2 discusses programming using the NX Journal Editor.

10 The only real advantage of this environment is that it requires no setup whatsoever you just access the Journal Editor from within NX, and you can start writing code immediately. But, by the time you reach the end of the examples in chapter 2, you will probably be growing dissatisfied with the Journal Editor, and you will want to switch to a true Integrated Development Environment (IDE) like Microsoft Visual Studio. Chapter 3 discusses Microsoft Visual Studio. We explain how to download and install a free version, and how to use it to develop NX Open programs. If you have some programming experience, and you already have Visual Studio installed on your computer, you might want to skip through chapter 2 very quickly, and jump to chapter 3.


Related search queries