Showing posts with label NX. Show all posts
Showing posts with label NX. Show all posts

Tuesday, September 23, 2014

Working with Spreadsheet Data in NX 9

How can we use a spreadsheet to drive the design of an NX part?

NX part files can contain, reference, and link to spreadsheet data. This is often used to define iterations or multiple configurations of a design such as Pattern features, Part Families, etc. Methods such as Patterns generally retain the spreadsheet data within the feature definition and not the part file as in the case of Part Families. This article discusses the application and use of spreadsheet driven data from both perspectives.

Spreadsheet Overview

The Spreadsheet serves as an advanced expression editor for NX hybrid modeling thus providing a seamless transfer of conceptual model data between NX and the spreadsheet.

This section focuses specifically on the spreadsheet extensions and applications in NX and is intended to be a supplement to the standard spreadsheet documentation, which can be viewed in the NX Documentation Set.

The spreadsheet consists of three main session applications:
  • A Gateway spreadsheet function, available in Tools tab→Utilities group→Spreadsheet.
  • A Modeling spreadsheet function, available from Tools tab→Utilities group→Spreadsheet. Some spreadsheet programs (such as " Goalseek"), may not be fully supported within the Modeling Spreadsheet extended functionality.
  • A basic Expression Editor. You can find the expression edit spreadsheet in the Tools→Expression dialog in Modeling. Click "Spreadsheet Edit."
While the spreadsheet functions are active, you have full spreadsheet functionality. You can edit and modify cells; change color, captions, and text; or even import or export spreadsheets that could have originated on a PC.

Gateway Spreadsheet

The Gateway spreadsheet is activated in current application modes except for Modeling.

NX will start a copy of Xess, or Microsoft Excel on Windows, and make connections to it automatically. Messages on the status line inform you of the progress made toward connecting with the spreadsheet. If there is a copy of the spreadsheet already running on your display that can accept connections, then NX uses that copy without invoking another instance of the spreadsheet.

Note:
  • If there is already a spreadsheet saved in the part, then that spreadsheet will be opened with the application that created it (Xess or Excel) regardless of the default spreadsheet set in the spreadsheet preferences. If there is no spreadsheet stored in the part, and you are running on Windows, the setting from Preferences→Spreadsheet (available only on Windows) will be used to determine whether to use Xess or Excel.
  • An Xess spreadsheet session started from a command line can accept connections to NX if you start the program with the command line options "-connect a" or if you toggle the Connections→Accept Connections option on the spreadsheet main menu bar. Remember that the NX specific version of Xess, xessu, cannot be started from the command line.

Modeling Spreadsheet


The Modeling spreadsheet is launched by Tools→Spreadsheet and requires that the current application mode be in "Modeling".

NX will start a copy of the spreadsheet and make connections to it automatically. Messages on the status line inform you of the progress made toward connecting with the spreadsheet. If there is a copy of the spreadsheet already running on your display that can accept connections, then NX will use that copy without invoking another instance of the spreadsheet.

Note:
  • If there is already a spreadsheet saved in the part, it will be opened with the application that created it (either Xess or Excel), regardless of the default spreadsheet set in its preferences. If there is no spreadsheet stored in the part, and are running on Windows, the setting from File tab→Preferences→Spreadsheet will be used to determine whether to use Xess or Excel.
  • In these discussions about the Modeling spreadsheet, the pull-down menus such as File→, Edit→, and Tools→ usually refer to options within the spreadsheet, not the pull-down menus from the NX main Menu Bar (unless specified).
Pattern Features

With the exception of the Reference Layout, a Spreadsheet option is available for all other layouts in the Pattern dialog. This allows the user to drive the design of the duplicated feature(s) to be driven by spreadsheet data. Once the feature to duplicate has been selected and the Layout requirements have been satisfied, the Use Spreadsheet option will become active.


NX allows the access of spreadsheet data directly from an outside file. There are two ways to do this, depending on what format you want.

1. Go to Tools→Import and Export Expressions, select the Import option, and browse for the spreadsheet file to bring in. You’ll note there are two formats you can filter for, “.xls” and “.xlsx”.

  A listing window reports the success or failure of the imported expressions:


This process allows outside spreadsheet data in .xls or .xlsx format to be brought into an NX part file directly as expressions but without any linking or associativity.

2. Go to Tools→Expressions and in that dialog at the top there’s an icon for Spreadsheet Edit.


This will start a new spreadsheet and from there you can open an existing spreadsheet or copy/paste from another spreadsheet. NX doesn’t offer an Import Spreadsheet command under File→Import but that does not matter if you can just open an existing spreadsheet using this method. Once the Worksheet is open, note the ADD-INS tab at the top resulting from the NX integration for spreadsheets in the NX installation.


Next to the Spreadsheet Edit icon in that dialog, there are also two icons for Import Expressions from File and Export Expressions to File. These two functions allow the copying of an expressions file (with the extension of “.exp”) into or out of an NX part file.


With the use of the spreadsheet and expressions functions discussed above, the NX user has the ability to reuse mathematical values, formulae, expressions, equations, and even character strings both inside and outside of an NX part file. This functionality is practically identical when working with assembly or drawing files as well.

However, these practices do not develop any associativity or linking between the data within the NX part and that or the spreadsheet or expression file.

Procedure for linking a value in a spreadsheet outside of a part file to an internal expression:
Expressions Icon

1.  Choose Tools tab→Utilities group→Expressions.
2.  In the Expressions dialog box, in the Name box, type “thickness”.
3.  Click Functions.
4.  In the Insert Function dialog box, from the Or Choose a Category list, select spreadsheet.
Functions Icon

5.  From the list of functions, select ug_cell_read.
Specify a Spreadsheet icon
6.  Click OK.
7.  In the Function Arguments dialog box, click Specify a spreadsheet.
8.  Navigate to the desired spreadsheet and click OK.
9.  In the Specify a Cell box, type the desired cell callout such as “B3”.

The Expressions dialog box is displayed and the function ug_cell_read("<SPREADSHEET_NAME>", "B3") appears in the Formula box.


10.  Click OK.
11.  Verify the value of the expression and click OK.

Migrating data between spreadsheet applications (Excel/Xess)

To assist you with migrating data between spreadsheet applications, NX provides a migration utility.

Platforms

On Windows, you can migrate spreadsheet data from Xess to Excel and vice versa. On all systems, you don't need to have access to the spreadsheet where the data is stored. You only need access to the spreadsheet to which you are migrating.

Required Software

When migrating from Xess to Excel, you only need Excel. Similarly, migrating spreadsheet data from Excel to Xess requires only Xess (which also means that Exceed must be present).

Before You Begin

Before you begin, make a copy of the part containing the old spreadsheet data. Keep the copy until you verify that the new spreadsheet data is correct.

In this example, the value of the expression is 2.5.

Note: If the spreadsheet is modified, you can update the expression by clicking Refresh Values from External Spreadsheet.
Refresh Values from External Spreadsheet Icon


Spreadsheets are also available in the Drafting application. As an example, a Tabular Note on a drawing can be edited using a spreadsheet. Simply right-click the handle of the Note and select Edit Using Spreadsheet from the popup menu.


Note that by default, Expressions functionality is not enabled in the Drafting application. It can be turned on either by editing the settings in the global customer defaults file (.dpv) or by going to File→Utilities→Customer Defaults→Drafting→Drawing→General tab, and toggle the Allow Expressions option on.


Written by
Garrett Koch
Application Engineer
Swoosh Technologies


Want to learn more about NX and improve your efficiency? Enroll in NX training or request a custom class or mentoring here today!


Wednesday, August 20, 2014

How to Acquire an NX9 License File from Siemens PLM

Installing NX is only half of the two main tasks required before NX can run. The second task is to install the license server, which requires a valid NX license file. The following post provides a detailed explanation of acquiring a license file directly from the Siemens PLM GTAC for new and existing NX customers.

Note: You will need a valid Webkey from Siemens PLM that is delivered after your account has been processed.

Starting with NX4, released in 2005, NX uses an updated version of FlexLM from FlexeraSoftware to manage its licenses. Most customers purchase floating licenses but even with node-locked licenses a license server must be installed.

Siemens PLM will issue a temporary 7-day license for you to use until you settle on what machine you want to install as a license server.  In the meantime, you need to gather three pieces of information:

•    Host ID – the physical address, or MAC address, of the computer’s Ethernet adapter.
•    Composite ID – the unique ID generated from the UGS_composite ID utility.
•    Hostname – the assigned name of the computer or server on which the license will be installed.

Note: The hostname in the license file is not the same as the host ID. The hostname and the composite ID become part of the NX license file.  If Siemens PLM is not provided with the hostname of the license server, it is the customer’s responsibility to enter it themselves.

Running the NX Setup Program

If you have already received the NX Installation media, run the NX setup program, “Launch.exe” from the software installation folder (i.e. nx-9.0.0-64bit) and click the “Get the composite host ID” option.


Acquiring the NX Setup Program

Download the utility from the Siemens PLM website or contact Swoosh Technologies support for the getcid.exe utility and run it on the server machine. The output of the ugs_composite utility looks like this:


Generally, the CID (composite ID) displayed will be the CID of the Ethernet Adaptor within the computer. If other CID’s are listed, they might include a Wi-Fi adaptor or other irrelevant networking devices within the computer. The CID is needed for Siemens to generate the proper licenses and cannot be edited by the customer. 

Next log in to the Siemens PLM GTAC website and enter the needed information. Expand the “License Management Group.”

New Customers

If you are a new customer, click “Register your Composite Host ID (CID).”


Select the “Composite Host ID” button.


Register your CID by entering the characters. After completing this step, Siemens will then process the information and generate a license file for THAT computer at your company. This may take 24-48 hours but the file will be emailed to the Customer Contact Email Address on file for your company.

To verify the Customer Contact on file, select the “Sold-To/Install” link shown above.

Existing Customers

If you are an existing customer with a CID on file with Siemens, select the option for “Current Licenses.”


Enter or select your Sold-To/Install number in the upper left and press Enter. Then select the “Passwords and License Files” link.


Select “Unigraphics NX” as the product and then “9” as the Version. (NX9 license files allow previous versions to run.) Then click “Continue”.


A new license file is created based on stored information for that Webkey account (MAC address, Composite ID, etc.). Download and Save the file (defaults to your temp download folder). Download and save the “ugnx9.dat” file to the appropriate folder.

This process works for getting license files for your current server on the file in your account with Siemens PLM. If you need to change server machines, contact Swoosh Technologies here for help in filing the request.

Checking the License File Content

Upon receiving the license file, you want to inspect the content.

1.    Check the Sold-To/Install number to make sure it is for NX and not Solid Edge.
2.    Check the Contact Name and E-mail Address to make sure it is the name and address of the contact or CAD administrator of the customer and not a contractor or outside service company.
3.    Check the creation date.
4.    Check that it is an NX9 license file.
5.    Note whether or not the server hostname has been included. If not, make sure that an explanation of changing it to the correct hostname is clearly communicated to the customer. The hostname (computer name) of the server MUST be included in the SERVER line of the license file in order for the license to work properly.
6.    Check the cid.
7.    Check that either the port “28000” or the word “any” follows the cid. This license service uses port 28000 by default, so that port must be unused on the license server or the port number will need to be edited to an unused number, i.e. 28001.
8.    Check for an expiration date – there should not be an expiration date if it is a permanent license file.




Have questions? Contact Swoosh Technologies’ support team today by calling (314) 549-8110.


Garrett Koch
Application Engineer
Swoosh Technologies

Tuesday, July 29, 2014

Creating a Reuse Library in NX 8.5

NX Reuse Libraries aid in assembly with jigs and fixtures by simply dragging the files into the manufacturing setup files. Sample Reuse Library files can be downloaded from Siemens PLM here; however, a webkey is necessary.

Follow these steps to setup a reuse library and create a reuse folder on your computer:

Start NX. This example uses NX 8.5.

Edit your customer defaults by navigating to File > Utilities > Customer Defaults.


A reuse library can be set up at the site level or the users level.


Next, map your new Reuse Library location. In the native NX area dialog box, add the path highlighted below.

NOTE: You may enter any path you wish after the | symbol.

Reuse Examples|$UGII_BASE_DIR/nxparts/Reuse Library/Reuse Examples
Reuse Examples|C:\Users\brian\Desktop\NX85_Reuse\CAM_Reuse_Library_Samples 


Select OK to save your defaults.

Exit NX.

Restart NX.

Your new Reuse Library should be now be displayed.


You are ready to create a model in your Reuse Library!

The model you create must reference the column heading in Excel.

Create a new file. Prior to creating any geometry, set up expressions for the column heading. Then create geometry referencing those expressions.

Save your file.

Enter the Reuse Library to view the model.


Learn more about NX Reuse Library and the Manufacturing Resource Library (MRL) through training with Swoosh Technologies. Register for a class or request a customized class here.

Written by
Brian Brown
Application Engineer
Swoosh Technologies

Thursday, July 3, 2014

How to Change the Units of an NX Part File

NX part files are defined with a basal unit of either inches or millimeters, which cannot be changed interactively within NX. This article discusses options that involve unit definitions, conversion, and how units can be managed.


Methods of Managing NX Units


Units Definition

NX provides two default unit system files: one English and one metric. You can choose one of these unit systems when you create a new part file. The settings for that unit system are then applied and stored with the file. By default, all parameters, values, dimensions, expressions, etc. will be created in the same generic system of measurement.

Note: NX does not allow the changing of the unit systems interactively within NX nor does it allow importing a part file of differing unit.


Converting Part File Units

Unit conversion refers to the actual conversion of a part from inches to millimeters, or vice versa. Unit conversion is a stand-alone external Open C and C++ API Program.

The program converts all model data appropriately and applies a conversion factor to all dimensional data (i.e., lengths, coordinates, origins, etc.). Non-dimensional data, such as angles, scalars, etc., are not affected. Therefore, the model maintains the same physical size after conversion.

The program changes the internal representation of the part by:
  • Converting internal values as necessary
  • Converting expressions
  • Maintaining display values (drawings and dimensions still display in their creation units)

Built-in (system) expressions are not affected such as “pi”, conversion factors, algebraic and logarithmic functions, etc.

Note: The behavior described below only applies to expressions created in NX 2 or older versions, as well as expressions created in NX 3 or newer versions, which have a dimensionality of Constant. That is, there are no units assigned to the expression.

Example of using ug_convert_part.exe :


Note that the default directory where the command line starts is in the folder of the username “garrett” on the computer. Therefore, in order for the operating system to find the actual command file, the pathname of the containing folder, C:\Siemens\NX8.5\ugii\, also needs to be entered in front of the command. This is the “root directory” of NX. There are other methods of running this executable.

Results of Conversion

Before:

After:


The Units Manager

The Units Manager allows you make changes to units of measure and create new unit systems. Create a custom unit when you want to use a unit other than the available five standard units. New information from each Units Manager session dynamically updates in all key dialogs. To do this navigate to Analysis > Units > Units Manager.

This tool should only be used in a controlled environment where all users accessing the data understand the practice and application of the managed units.

Built-in Conversion Functions 

NX expressions allow you to convert values as you enter them in value fields as shown below.

It is often necessary to enter values into text entry fields that are based on another unit system than that of the Work Part such as creating a clearance hole in an inch part file to accommodate a metric fastener. The value of the hole diameter can be entered as the metric diameter converted to inches in an expression.


NX Help lists all of the built-in conversion functions as follows:

Function Description
cm cm(x) converts x from centimeters into the default units of the part file.
ft ft(x) converts x from feet into the default units of the part file.
grd grd(x) converts x from gradients to degrees.
in in(x) converts x from inches into the default units of the part file.
km km(x) converts x from kilometers into the default units of the part file.
mc mc(x) converts x from microns into the default units of the part file.
minute minute(x) converts x from minutes into degrees.
ml ml(x) converts x from mils into the default units of the part file.
mm mm(x) converts x from millimeters into the default units of the part file.
mtr mtr(x) converts x from meters into the default units of the part file.
sec sec(x) converts x from seconds into degrees.
yd yd(x) converts x from yards into the default units of the part file.

Units Converter

Instead of using a conversion function, a simple unit converter command can be executed during a command. This gives the user the value desired for the text entry field of the feature. It is a simple “constant” value for the parameter of the feature. To do this navigate to Analysis > Units > Units Converter.


Simply enter the value you have in the “From” field and select the units of the value. The “To” field immediately reports the converted value in whatever unit is selected.

Changing the Analysis Units Option


Performing a distance measurement results in a linear value in the same units as the part file by default. At any time, the analysis (measurement) units can be changed to whatever unit system is desired by executing a Simple Distance Measurement command (see below).


Then select two objects in the graphics area. A ruler and a value box appear with the value in part file units.
  • For an inch part, the default will be lbm – in.
  • For a metric part file, the default will be kg – mm.

Follow these steps to change the units:

1.    Choose Analysis->Units.
2.    Change the units from inches to millimeters.


3. Measure the length again and the popup will be in millimeters.


4. Measure the diameter of a hole… also millimeters.


Stop now and consider the ramifications…

Changing the units in the Analysis drop down has a tremendous impact on subsequent modeling functions!


Changing the Analysis Units –CHANGES THE MODELING UNITS!

Before:


After:

It should be understood that this modification of the analysis units is NOT changing the unit system of the part file, only the units in which all expressions are being created. And, as you can see above, none of the existing expressions are affected.

Default Behavior in Other Applications 

NX Assemblies are able to contain components of mixed units without lack of functionality with the exception of Working In Context – the Work Part cannot be a Component file with different units from the Displayed Assembly.

Regardless of the units of the Master Model, the Drafting Application is able to allow either inches or millimeters for:
  • The Drawing file
  • Drawing Sheet sizes (“A0, A1, A2” etc. vs “A, B, J,” etc.)
  • Drawing and View Scales
  • Dimensions (can be either or Dual Dimensioning)
CAM data is not dependent on model units.

Summary

This article discussed options that involve unit definitions, conversion, and how units can be managed.

In an engineering/manufacturing environment where unit definition is mixed, robust solutions are available. With the various methods offered by NX, however, the user must be careful and think of downstream applications that may be affected. Also, corporate standards should dictate how these methods are to be implemented to avoid confusion and errors.

Written by: 

Garrett Koch
Application Engineer
Swoosh Technologies

Tuesday, June 24, 2014

Creating Macros for Customization in NX

The simplest way to customize NX is through the use of macros

A macro records a series of keystrokes in order to automate them into a simple keystroke or an icon on a custom Toolbar. Any series of keystroke a NX operator does repeatedly should be considered for a macro in order to speed up the process.

 Follow these steps to create a macro:
  1. Select the tools drop down menu
  2. Select macro
  3. Select start record

Note: Macros have to be updated between releases.

Macros can be setup for user interaction also and can be paused to give the user instructions. Macros can be setup with user entry boxes or file selection dialog boxes.

Watch the video below to view a macro I created to change the color to green and my translucency to 75%. The video shows how I created the macro and un-did the macro’s result. The video also shows the playback of the macro created for testing.


Brian Brown
Application Engineer
Swoosh Technologies

Tuesday, June 10, 2014

Customize Radial Menus in NX 9

Radial menus in NX are small icons that appear surrounding your cursor location; each icon can be customized to your most used features. These menus allow you to quickly and easily access features with a click and swish of your mouse. Follow the instructions below to get started customizing your NX experiences:

To access this menu in NX 9, open NX and right click on some empty space on the toolbar and click Customize.


Scroll to the bottom of the list and locate options for radial menus 1 to 3. In order to customize each menu click the box to the left of the heading.


With the first menu up while in customize mode, drag your most used features from the main menu bar into one of the eight spaces available in the radial menu. The horizontal and vertical positions on the radial menus are the easiest to access; therefore I suggest placing your most frequently used functions here.


All three radial menus can be customized using this method. I use each menu for a different set of tools (e.g. 1. Basic modeling, 2. Sketching 3. Synchronous tools).


In order to utilize the menus the 1st (left click), 2nd(Middle wheel click) and 3rd (right mouse click) must be completed while holding down Control and Shift. To make this process easier, I assign Ctrl and Shift to a function key making it very easy to instantly access any function.

Matt Beisel
Application Engineer
Swoosh Technologies