# Presentation: 684636

## STEP and Scriptable CAx Tool Integration

- Doug Cheney
- Senior Software Engineer
- International TechneGroup Incorporated

## Data integration : Exchange product data via a STEP model representation
Complete, standalone definition of model
Requires two model conversions: native to standard to target
Native model is duplicated in standard and target system formats
Systems integration : Share product data via CADScript--a neutral application programming interface
Only data and behavior needed by applications
Requires access to licensed installations of CAD systems
Native model stays in native system

- Complete, standalone definition of model
- Requires two model conversions: native to standard to target
- Native model is duplicated in standard and target system formats
**Systems integration : Share product data via CADScript--a neutral application programming interface**
- Only data and behavior needed by applications
- Requires access to licensed installations of CAD systems
- Native model stays in native system

**Complimentary Interoperability Approaches**

## CADScript Overview

**Multi-CAD data and algorithm access**

**with scripting ease**

**and platform independence**

## Complimentary Usage Scenarios

**Data integration using STEP**
- Multi-disciplinary repository of all product data
- Long-term data retention
- Legacy data migration
**Systems integration using CADScript**
- Multi-CAD application
- Collaborative engineering
- Cross-platform application
- Multi-system assembly design

## Multi-CAD Application Example

**Application Domain**
- CAD Model Quality Control
**Key CAD Interface Requirements**
- Support for each of the major CAD applications (e.g., CATIA,    I-DEAS, Pro/E and UG) and formats (IGES, STEP, Parasolid)
- Access to native CAD data and algorithms (no data exchange)
- Identical diagnostic algorithms for all systems
- Focus on diagnostic development, not system integrations
**Application Integration Success Metrics**
- CADScript V2.0 – 130K lines of C++CADScript V3.0 – 29K lines of Python
- CADScript V3.0 – 19 DiagnosticsCADScript V4.0 – 40 Diagnostics

## Multi-CAD Application Architecture

**CADScript**

**Pro/E**

**CATIA**

**UG**

**I-DEAS**

**PDE/Lib**

**Application**
**Algorithms**

- Menu
- Callbacks

**Application**
**User Interface**

**Customer Software**

**ITI Software**

**CAD Vendor Software**

## Collaborative Engineering Example

**Application Domain**
- CAD Model View and Mark-up
**Key CAD Interface Requirements**
- Support for each of the major CAD systems (CATIA, I-DEAS, Pro/E and UG)
- Model query using precise measurements (i.e., no translation)
- Assembly based queries
- Web based client/server architecture
- High performance and large scalability
**Application Integration Success Metrics**
- Very short time-to-market for “production-ready” (multi-CAD) visualization product (less than 6 months)

## Collaborative Engineering Architecture

**Web Browser**

- class PartSession:
-    def demo(self)
-    def demoStep2(self, partFile, tesTol, edgeTol)
-    def display(self)
-    def area(self, uniqId)
-    def length(self, uniqId)
-    def modifyParameter(self, uniqId, rhs, type)
-    ...

**URL Call Mapper**

**CADServer**

- HTTP (URL)
- requests

- Calls

**Example browser request:**

- http://host.iti.com:8085/demoStep2?partFile=TJ_SOLE.model&tesTol=.01&edgeTol=.01

**Customer Software**

**ITI Software**

**CAD Vendor Software**

**CADScript**

**Pro/E**

**CATIA**

**Client**

**Server**

**Java **
**Applet**

**UG**

**I-DEAS**

**PDE/Lib**

**Application Server**

**Notes:**
The web browser demonstration uses a simple HTML based interface to allow viewing and modification of parameters in a model located on the server.  The server session code is defined in a class called “PartSession”.  When a URL is accessed by the web browser, a method in the PartSession class is invoked that generates and returns HTML to the browser.  This HTML contains additional links (that map to methods in PartSession) as well as some JavaScript code and a reference to a small Java applet that allows 3D visualization and interaction.  When loaded, the viewer requests a tessellated representation of the model from the server.  The viewer can be put into a mode that allows the user to select edges or faces.  When an entity is selected, a server side method is called to compute the length or area of the entity (the computation is done in the CAD system via CADScript).  An additional HTML page allows the user to view and modify parameters in the model.   After making changes, the model can be regenerated by a button in the viewer.

## Cross-Platform Application Example

**Application Domain**
- Coordinate Measuring Machine (CMM)
**Key CAD Interface Requirements**
- Access UNIX-only CAD (CATIA V4) data from an NT client
- The application requests a tessellated version of the CAD model from the server, the precise CAD geometry/topology is never sent to the client
**Application Integration Success Metrics**
- Realization of NT-only solution with access to UNIX data

## Cross-Platform Application Architecture

**CMM**
**Application**

- class ApplSession:
-    def displayPart()
-    def gridFace()
-    def projectPoints()
-    ...

**Application Server**

**URL Call Mapper**

**CADServer**

- class CadModel:
-    def displayPart()
-    def gridFace()
-    def projectPoints()
-    ...

**C++ Proxy Layer**
- (automatically generated from PartSession.py)

- Menu
- Callbacks

**Customer Software**

**ITI Software**

**CAD Vendor Software**

**CADScript**

**Pro/E**

**CATIA**

**UG**

**I-DEAS**

**PDE/Lib**

**Application Client**

**NT Client**

**UNIX Server**

- HTTP (URL)
- requests

## Multi-CAD Assembly Design Example

**Application Domain**
- Parametric Assembly Design
**Key CAD Interface Requirements**
- Dynamic access to the latest version of component models in any supported CAD system (CATIA, I-DEAS, Pro/E and UG)
- Interact with all components within a single CAD system user interface
- Model query using precise measurements (i.e., no translation)
- Parametric modification of remote components driven by local parameters
**Application Integration Success Metrics**
- Enabling true multi-CAD assembly design!

## Multi-CAD Assembly Design Architecture

**Unigraphics**

- class PartSession:
-    def openModel()
-    def parameters()
-    def modifyParameter()
-    ...

**Application Server**

**URL Call Mapper**

**CADServer**

- class PartClient:
-    def cmdAddExtPart()
-    def cmdExtPartMass()
-    ...

**Client**

**Server**

**Python Proxy Layer**
- (automatically generated from PartSession.py)

- Menu
- Callbacks

**CADScript**

**Customer Software**

**ITI Software**

**CAD Vendor Software**

**CADScript**

**Pro/E**

**CATIA**

**UG**

**I-DEAS**

**PDE/Lib**

**Application Client**

- HTTP (URL)
- requests

**Notes:**
The embedded client consists of a CADScript program running within the UG environment.  The key class in the program is called “PartClient”.  During construction, PartClient registers several menu callbacks so that picking items in the new FIPER menu results in a PartClient method being invoked.  
PartClient communicates with the same server as the web browser demonstration used.  However, instead of requesting URLs, it uses a proxy layer that was automatically generated from the PartSession.py file.  The proxy layer contains a class that mirrors the PartSession class and its methods on the client side.  This allows the client code to interact with PartSession methods as if they were all local rather than running on another system.

The PartClient class maintains several data structures to allow “external parts” to be instantiated within the UG environment.  Although these parts look like UG geometry, they are actually UG user defined objects with graphics that are obtained from the server.  The FIPER menu adds a number of commands for interacting with these parts.

Almost all the code in PartClient is independent of the CAD system it is running in.  The only UG/Open calls made are for creation of UDOs to represent the external parts.   

## Summary

**System integration is a complimentary approach to data integration using STEP**
**System integration empowers dynamic usage scenarios**
- Instant access to the latest versions of native CAD models
- Precise measurements performed by native CAD systems
- Consistent parametric modifications across CAD systems
- Flexible software architecture enabling remote CAD system control via URL calls
- Rapid application development without software integration nightmares (no build problems)
- Simple, concise, and intuitive application logic
- Multi-CAD assembly design example: client is only 570 lines of Python code, server is only 551 lines