The 3D ACIS® Modeler (ACIS) is Spatial’s prominent 3D solid modeling engine. 3D InterOp is a CAD data translation framework (Interoperability)
InterOp:Connect/Using Samples
From DocR19
Contents |
InterOp Samples
InterOp Connect samples are located in the installation subdirectories /samples/connect, /samples/connectacis, and /samples/connectgeneric.
The directories include:
| Functionality | Sample Name | Description/Comments |
|---|---|---|
| Basic Translation | Simple | Execute a simple translation from input file to output file. |
| Log File Setup | LogFile | Generate a log file providing information about the execution of a translation. |
| Document Header Information | DocumentInfo | Extract header information from an input file. |
| Multi Model Header Information | MultiModelDocumentInfo | Extract header information from an input file containing multiple models. |
| BRep Information | BRepInfo | Extract BRep information from an input file. |
| Assembly Information | AssemblyInfo | Extract assembly information from an input file. |
| Options Setup | Options | Set options for a translation. |
| Representation Selection | Representation | Select a document representation for a translation. |
| Unit Setup | Unit | Set an output file unit for a translation |
| Assembly Translation | AssemblyXML | Translate an assembly input file to XML-EBOM. |
| International Path Handling - Multibyte | Simple_Mbcs | How to handle Paths with Multibyte Characters. |
| Import ACIS Entities1 | AcisImport | Import a file to ACIS Entities. |
| Export ACIS Entities1 | AcisExport | Export ACIS Entities to a file. |
| Import Manufacturing ACIS Entities1 | AcisMiImport | Import Manufacturing information from a file to ACIS Entities. |
| Import Hole Feature to ACIS Entities1 | AcisHoleImport | Import Hole Feature information from a file to ACIS Entities. |
| Import Parasolid Entities2 | ParasolidImport | Import a file to Parasolid Entities. |
| Export Parasolid Entities2 | ParasolidExport | Export Parasolid Entities to a file. |
| Import Generic Entities3 | GenericImport | Import a file to Generic Entities. |
| Export Generic Entities3 | GenericExport | Export Generic Entities to a file. |
| Import Manufacturing Generic Entities2-3 | GenericMfgImport | Import Manufacturing information from a file to Generic Entities. |
1 ACIS-based applications
2 Parasolid-based applications
3 Generic-based applications
Note: In order to rebuild the Spatial samples, you must add your license to the sample source code. The sample source file unlock_license.cpp contains a function unlock_license() which is called by every sample at startup. Modify this file to call your application license function.
Building the InterOp Connect Samples
To build a sample, refer to the procedure for your platform:
Visual C++ 6.0:
- Open a command prompt window and set up the environment.
- Set X3DT to your InterOp installation folder, for example: set X3DT=c:\Progra~1\Spatial\iop
- If you have an ACIS installation, set A3DT to your ACIS installation folder, for example: set A3DT=c:\Progra~1\Spatial\acis
- Change directories to the samples directory: cd %X3DT%\samples\connect
- Build the sample project (repeat these steps for each project).
- From the samples directory, enter: msdev AssemblyInfo.dsw
- Select Build->Set Active Configuration.
- For Win32 Release, choose AssemblyInfo.
- For Win32 Debug, choose eAssemblyInfo.
- Select Build->Build AssemblyInfo.
Visual C++ 2003 .NET and Visual C++ 2005
- Open a command prompt window and set up the environment
- Set X3DT to your InterOp installation folder, for example: set X3DT=c:\Progra~1\Spatial\iop
- If you are have an ACIS installation, set A3DT to your ACIS installation folder, for example: set A3DT=c:\Progra~1\Spatial\acis
- Change directories to the samples directory: cd %X3DT%\samples\connect
- Build the sample project (repeat these steps for each project).
- From the samples directory, enter: devenv AssemblyInfo.sln
- Select Build->Configuration Manager.
- For Release Win32, enter AssemblyInfo.
- For Debug Win32, enter AssemblyInfo.
- Select Build->Build AssemblyInfo.
UNIX (using make) and Macintosh
- From the shell, set up the environment
- Set X3DT to your InterOp installation folder.
- If you have an ACIS installation, set A3DT to your ACIS installation folder.
- Set ARCH to the architecture you want to build, for example: export ARCH=aix4_so
- Change directories to the samples directory: cd$X3DT/samples/connect
- Build the samples (default target builds all samples, for example, make -f makefile.aix4): make -f makefile.*
Note: The ACIS dynamic libraries are linked with the option:-Wl,-install_name,@executable_path/libXXX.dylibFor bundled applications, ACIS libraries must be in the executable directory at runtime (for example, YourApp.app/Contents/MacOS). You can avoid this requirement when running from the command line by setting the environmental variable DYLD_LIBRARY_PATH to the library location.
Working with Localized File Paths
InterOp is able to work with localized file paths encoded as either mutlibyte character set (MBCS) or as wide characters.
- Multibyte
- To work with localized file paths in InterOp, you will need to set the system's locale to match the locale of the text for the file path. Generally this means setting the locale to the system's default codepage. If the APIs your application is built upon do not do this for you automatically, refer to the InterOp sample International Path Handling - Multibyte for an example of how to accomplish this.
- When working with MBCS encoded file paths, use the Connect interfaces that use char* arguments. For example, you would use the SPAIFile(const char* ipszFilePath) constructor to initialize a SPAIFile object.
- Wide character
- Working with wide character encoded file paths requires that you use the Connect interfaces that use wchar_t* arguments. In this case, you would use the SPAIFile(const wchar_t* ipszFilePath) constructor to initialize a SPAIFile object.
- Refer to the InterOp sample Basic Translation for an example of how you can process localized file paths using the Connect API.
Windows
On Windows systems, the C-Runtime APIs interpret char* text as either ASCII or MBCS depending upon whether the preprocessor symbol _MBCS is defined. Therefore, to use the char* form of the Windows APIs and have them work properly with localized text, you must ensure that _MBCS is defined for your application (and that _UNICODE is undefined if you are using the Generic-Text Mappings.) If you chose to use MBCS encodings for localized text on Windows systems, you are limited to processing text in a single language.
On Windows systems, the C-Runtime APIs interpret wchar_t* as UTF-16, which is one of several Unicode encodings. Note that this interpretation of the wchar_t type is unique to Windows and is not applicable to other platforms. Because Windows systems define its wide character encoding to be UTF-16, using the wchar_t interfaces allows you to process text involving more than one language.
UNIX and Macintosh
On UNIX based systems, the C-Runtime APIs interpret char* text as being encoded as MBCS and wchar_t* text as being encoded as wide characters. In both cases, the text encoding is relative to the currently defined locale. Note that, in general, on UNIX based systems the wchar_t type is not Unicode. It is only interpreted as Unicode when the current locale is Unicode. For example, if you are running on the Solaris platform under the en_US.ISO8859-1 locale, then the wchar_t type would not represent Unicode, but rather the wide character encoding of the ISO8859-1 codepage. If, however, you are running under a UTF-8 locale such as en_US.UTF-8, then the wchar_t type would be Unicode - in this case UTF-32 (because wchar_ts on Solaris are four bytes wide). Therefore, unless your locale is set to Unicode, you are limited to processing text in a single language.
The InterOp sample International Path Handling - Multibyte shows you how you how to use InterOp using MBCS text and the sample Basic Translation shows you how to use InterOp using wide character text.
Known Limitations
- CATIA V5 is not able to process file paths comprising of wide characters.
- HP and AIX are not able to process Unicode text that falls outside the Basic Multilingual Plane (BMP).
