Excel/Open I-DEAS Demonstration

A demonstration of using Excel on NT
with I-DEAS Master Series 6(a) on NT or Unix

Courtesy of:
Mark Crawford
Sr. Software Engineer, SDRC Integration Services
513/576-7836  mark.crawford@sdrc.com

Version 1.3

Introduction | Requirements | Installation | Use | Open Issues | Methodology | Further Information | Versions 

I-DEAS/Excel

Introduction

This demonstration allows an Excel spreadsheet to connect to and interact with an interactive I-DEAS MS6(A) session.
Functions available include:

bulletRetrieving bin and part lists from the active model file
bulletBringing parts and assemblies to the workbench
bulletSending commands
bulletGetting, setting, and updating dimensions
bulletGetting IDM attributes and part/assembly mass properties
bulletWorks with any MS6 or MS6A parts or assemblies

The demonstration consists of an Excel spreadsheet (OILink13.xls), a Broker executable (OILink_6.exe or OILink_6A.exe), and a number of support files.  The Excel spreadsheet and broker program must run on an NT system, but can connect to an Orbix daemon and I-DEAS executable on either Unix or NT, on the same system or on a networked system.

The goal of this application is to show the techniques and opportunities for using Open I-DEAS for Windows NT as an OLE automation tool.  The techniques demonstrated could be used to allow I-DEAS to communicate with Visual Basic, Visual Basic for Applications (VBA) based products (Excel, Word, Access, Visio), or other OLE enabled languages and applications.

Requirements

I-DEAS Server (a Unix or NT based system):

bulletSDRC I-DEAS Master Series 6 or 6A
bulletIona Orbix 2.2 or later (as installed with MS6 or MS6A)

Excel Client (an NT-based PC, can be the same machine as the server above)

bulletMicrosoft Excel for Windows 95, Version 7.0a
(Note: the application may run on later versions of Excel, but has not been tested.)
bulletWinZip 6.3

Installation

        (Note: Steps 1-4 only need to be performed once.  For any following demo runs, only steps 5 and 6 need to be performed.)

  1. Download the zipped file containing the demonstration code:
    bulletoilink_ms7.zip for I-DEAS Master Series 7
  2. Unzip oilink.zip (oilink_ms7.zip) into a selected directory of your choice (Example: c:\oilink).
  3. Confirm IT_CONFIG_PATH environment variable is set.
  4. If you have installed I-DEAS and Orbix on your NT system, this environment variable may already be set.  If you do not have Orbix installed (which is not a requirement for the Excel client machine), you will have to set this environment variable manually.  To check or set this variable, go to Settings, Control Panel, System, and select the tab labeled Environment (as shown in the diagram below).  If IT_CONFIG_PATH is shown in the list of System Variables, no further changes are needed.  If not, enter IT_CONFIG_PATH as a User Variable by first entering IT_CONFIG_PATH in the Variable field, and then entering the full path of the selected directory (from step 2 above) in the Value field (example: c:\oilink).

    (Note: The goal of this entry is to have IT_CONFIG_PATH point to the directory containing the file orbix.cfg which is the Orbix configuration file used during connection to the Orbix daemon.  If you have a copy of orbix.cfg in some other directory, IT_CONFIG_PATH could be set to point there instead.)

  5. Register the OILink broker component.
  6. To register the broker, you must run OILink_6.exe or OILink_6A.exe (depending on which version of I-DEAS you are running).  You can run it from an explorer window by opening the directory containing the OILink components and double clicking on OILink_6.exe or OILink_6A.exe.  When run and successfully registered, you'll see the following window:

    (end of Installation Steps)
    (beginning of Run Steps)

  7. Start an interactive I-DEAS session.
  8. When starting I-DEAS, ensure that Open I-DEAS is on.  The following messages should appear as part of the I-DEAS startup:
    Loading Open I-DEAS Server Shared Library .......
    Initializing Open I-DEAS Server .......
    If there are any errors initializing Open I-DEAS, the demonstration will not be able to connect or interact with I-DEAS.

    Start I-DEAS with the model file containing the example parts or assemblies you wish to use.  Before starting the Excel application,
    it is suggested that all items be cleared from the workbench, and that the application be set to Design, with the task set to Master Modeler.

  9. Run the OILink13.xls spreadsheet in Excel.
  10. Open Excel as you normally do and load the spreadsheet OILink13.xls.  The spreadsheet will automatically reset itself and be ready to run.
    Follow the use instructions in the following section.

Use

NOTE:  While using the spreadsheet, if you click into a field to change an entry, you must click somewhere else in the spreadsheet before trying to press a button.  This is a peculiarity of using buttons in Excel spreadsheets, not an application bug.  Also, Excel may warn you about macros being present in the spreadsheet.  If presented with that warning dialog, select "Enable Macros."

The easiest way to use the demonstration is to follow the steps listed on the spreadsheet.  Each function is outlined below.  The spreadsheet will also disable any buttons that may not be appropriate in a given situation.

bulletStep 1.  Load OI Broker.
This button connects the broker executable to Excel.
bulletStep 2. Connect to I-DEAS.
This button has the broker connect to an active I-DEAS session.  This is the key step in making the I-DEAS connection.  Usually, if this works, all other functions will too.

There are two fields to specify here.  One is Server, which is the name of the Open I-DEAS server to connect to.  In all cases where you are the only user of the active I-DEAS session, this name will be SDRC/OpenI-DEAS.  The host name identifies that machine on the NT (and/or Unix) network.  It can either be an actual name (such as sgiop95 or localhost) or a host IP address (such as 146.122.60.10).

(NOTE: On a standalone PC running I-DEAS and Orbix locally, use hostname localhost.  Using localhost prevents network checking delays that occur when an actual host name is used.)

(NOTE: The initial connection can take some time.  You may see the message:

This may indicate a slow initial connection (you may see the message more than once).  It also may indicate I-DEAS was left in the middle of an operation, and the Excel client cannot communicate with it.

You may also see the message:

This usually means either I-DEAS is down, the Orbix daemon is not loaded or configured correctly, or Open I-DEAS is not available.

bulletStep 3 - Choose and Get Part or Assembly
This button selects a part or assembly from the bin and part/assembly selected in the neighboring pull down lists.
You may see the following error, which means the bin is empty.  By default, the application starts in the Main bin.

When the button is pressed, the part or assembly is retrieved and placed on the workbench.
bulletStep 4 - Get Dimensions
This button retrieves up to 18 dimensions from the selected part.  The dimension names are as provided by I-DEAS, values are in SI units.
bulletStep 5 - Set Dimensions
To set dimensions, go to the Dimensions Value column and reenter any dimensions value shown.  If you make a mistake in entry, go back to Get Dimensions and re-read the values.  Press the Set button when your changes are complete.  This causes the new values to be written to the part, where they will be pending until updated.
bulletStep 6 - Update Changes
This button updates the part or assembly on the workbench.  NOTE:  If you set a dimension to an invalid value, or changing a dimension is somehow invalid to the part, you will see errors during update.  The demonstration does no error checking of dimension values or validity.
bulletStep 7 - Put Away Part or Assembly
This button causes the part or assembly on the workbench to be put away.
bulletStep 8 - Disconnect from I-DEAS
This causes the Excel spreadsheet to disconnect from the I-DEAS session.
bulletStep 9 - Unload OI Broker
This button disconnects the Excel spreadsheet from the C++-based broker executable.
bulletOptional - Send Command
This button sends the contents of the accompanying Command field to I-DEAS as if the command were typed into the prompt region.  Any valid program file type command should work.
bulletOptional - Get Part/Assembly Database Attributes and Get Part/Assembly Properties
These buttons retrieve the current IDM database attributes or the mass properties respectively for the currently active part or assembly.  A pop up window shows the results of the query.
bulletReset
This button may be used at anytime to reset the state of the Excel spreadsheet to the normal starting condition.  If an error occurs, a Reset is recommended.
bulletAbout...
This button displays contact and version information for the application.
bulletAdvanced use
Generally, any enabled buttons may be clicked at any time, as the program attempts to disable any buttons that are inappropriate for a given condition.  The ineractive I-DEAS session may also be used to change views, etc. during demonstrations.  Take care in making changes to the interactive I-DEAS session during use of the demonstration, as there are not currently checks in place to confirm, for instance, that a part the application placed on the workbench was not put away by the interactive I-DEAS user.

Open Issues

While there are no current known issues, the broker and the spreadsheet are very new, and there may be error conditions that arise that have not been trapped or well handled.  Please document any errors or incorrect behavior and contact the developer.

Methodology

Basically, there are two applications that were developed for use in the demonstration.  One is the Excel spreadsheet and its corresponding VBA macros.  The other is a Visual C++-based OI/OLE broker program.  The Excel spreadsheet interacts with the broker by calling broker functions with have been exposed as OLE automation objects.  The broker runs in the background and acts as a go-between for Excel and I-DEAS.


 

Further Information

For bug reports, installation questions, or other application issues, please contact:
Mark Crawford
Sr. Software Engineer, SDRC Integration Services
513/576-7836  mark.crawford@sdrc.com

For information on custom integration services, including consulting, training, design, and development for NT and Unix based I-DEAS environments, please contact:
Mark Millburg
Director, SDRC Integration Services
513/576-2434 mark.millburg@sdrc.com
- OR -
Your local SDRC sales representative.

Versions

bullet1.0 - Initial Release
bullet1.1 - Updated information about using localhost as host name on standalone PCs.  Corrected error for parts with more than 15 dimensions.
bullet1.2 - Updated OILink.exe with extended error and exception handling.
bullet1.3 - Added support for I-DEAS Master Series 6A